It's been my experience, that most computers that suddenly restart on their own is caused by a faulty power supply. It can easily be checked by hooking up a digital multimeter into the back side of the motherboard power connector and watching to see if the voltage is actually changing when the PC restarts.
If the power supply seems fine, then I usually suspect one of the voltage regulators on the motherboard (in which case the motherboard is going bad). I have also seen software and hard drive failure issues cause this problem as well, but usually the PC provides you with some sort of error message when that happens.
Hope this helps (it should at least give you a starting point to troubleshoot from).