r u sure it was the RAM? have u tried another stick to see if that's indeed the problem?
i once had a user having a similar problem, she took the tower to PC World which told her it was the end. Then she asked for my help. I did a few tests and eventually found out that the PC was infected. After i re-installed everything got rid of the virus, the PC has been in tip top condition since.
Other things to look out for could be video cable loose or bad driver.
Although the ram does sound faulty, download a program called memtest (google that)
the program is only 16kb and the longer you run it, the better the test. (Run it for a period of 12-however long you want)