The EXACT errors you were seeing might help us.
In the meantime, the repeated restarting seems to indicate that it's not the hard drive and probably not the Windows installation.... but as to the other items, it could be a number of things.. First, make sure to blow out all the dust and junk from the around the fans and processor, the heatsink, and all other areas inside the tower.. Next, see if there are any bulging capacitors on the motherboard which would indicate heat damage. Also, if you've ever worked on the heatsink or processor, the problem could also stem from the lack of heat dispersion in the thermal paste.. Removing the old and replacing with a thin coating of new paste can fix that issue.
Next, the RAM is indeed a possiblity but the only way to test is to swap in a known good stick..
Hope this helps.
Grif
System specs: AMD Athlon64 3000+ CPU, MSI Socket 745 motherboard, 512MB DDR RAM, 80GB hard drive, Windows XP SP2.
Problem: Okay, recently I have been getting error messages saying various Windows components failed and I was in need of an restart. This went on for about two days before a more serious problem started occurring, random restarts. With no warning, all the hardware components (Fans, Hdd ,etc) would power down and restart. I figured it was my install of Windows going bad so I reinstalled it. But the problems continued. So, today, I get another Windows component failure message so I restarted, only it wouldn't load Windows. It would get past the BIOS screen and restart. I thought it was the HDD but I swapped it out with a working one and it still wouldn't load Windows. Next, I tried a power supply swap ending in the same result. I couldn't try a RAM swap due to lack of additional DDR RAM. So, my question is, could it be the HDD, RAM, or the motherboard causing the problems?

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic