See #4 here: How to Troubleshoot Raspberry Pi Crashing.
And this might help after you recover: SD Card Reliability.