might be corrupting hard drive or cpu temps rising or even possible misconfigured cpu or overclocked.

next time it happens pull out all ram but leave one stick in a see what happens. make sure fan is spinning and feel your power supply to see if that thing is hot.