Ok, the next time it does this, immediately go to control panel to check out the event viewer log under administrative tools, and check to see what's causing this problem, it should definitely list the crash as an error/critical problem. If you highlight it and read what it says, it should give you some kinda hint as to what may be the cause.
Also, try doing a system restore to revert back to a date the PC wasn't doing this. Right click the start button, and go to "system," on the left pane choose "system protection," then click on "system restore" and follow along with the prompts.
**Now, if you're trying to Re-install Windows 8 completely. Try doing it on another known good working HDD first, if it works on that one, then you know for certain it's an HDD problem. We need to eliminate possible causes before getting to the root.
Check for any loose connection leading to your motherboard and HDD as well, make sure you're grounded from ESD before you do.