I had the same problem on two occasions. Once was with a bad RAM module. The other was with a bad video card. If you have Windows 7, run the windows memory diagnostic tool (try to get it scheduled before it shuts down on you). Then restart the PC when prompted and let it do its thing.
The title of this topic has been edited by Tecmo34
If your issue is solved now, please let me know and I'll close your thread. Based on your post, it doesn't sound like it is solved, which is why I removed your [Solved] comment to allow other users to respond and help out.
Sounds like a PSU problem. When my power supply was overheating, my pc would just power off. If you're not sure if this is the issue, bump the back of your pc lightly, and then harder. Don't SLAM it, but thump it. If the PSU is having issues, or overheating, the pc should shut down. Then you've isolated your issue. thanks! Hope this helps!
If it happens randomly one of the reasons could be overheating of CPU or Graphics card (sometimes because their fans aren't working properly or if the heat sink is not firmly attached)...get a program to check your CPU/GPU temp. Otherwise like "ubercake" said it could also be RAM problem...