My guess is bad ram or a defective hard drive.
The ram is easy to test:
http://www.memtest86.com and download the 3.0 version. You'll need a new floppy to extract it onto. Boot the computer off the floppy and let the system run (512 MB ram takes about 35 - 45 minutes to test). You will see if any errors occur, and at the end of the 9 tests it runs you'll get a pass or fail. The tests will repeat until you hit escape.
You should also run a scan disk on the hard drive. If that passes, do another scan disk with the "surface scan" option turned on. This will take an hour or more. Don't just assume new drives are good, I've had 4 Western Digital drives (2 20GB and 2 40GB drives) fail on me in the last 8 months. Two of them failed after a few days and the others lasted about 6 months.