Guys Guys !! You should start from the grassroots level.
First, the software part.
No diff b/w genuine/nongenuine OS but I do not recommend installing WGA and antWGA patches which can mess things up.
Now, how long have you been having this problem?
Check if System Restore to a previous date (before the problem occurred is possible and try it.
If not try to remember if you installed some new drivers or software.
For instance, I can reproduce this problem on my system using old creative drivers or the Logitech Mouseware (always causes my system to reboot at awkward times).
Pesky malware or even an ovezealous firewall (like the norton, mcafee bloatware) can cause driver conflicts.
Are you having the problem on another OS.
Try installing Win98 or Linux.
If the problem persists on other operating systems then certainly, the fault is in hardware.
The PSU may be sending variable power or even the UPS.
If you are not using a UPS, then perhaps you may be having voltage fluctuations or maybe the socket may be shorting.
Now after these go on check your RAM or even your hard disk( may be developing bad sectors). Run checkdisk for the latter.
Then come see us again.