Well we've got 2 things to look at.
1. power supply. possibly going bad, get a voltometer and check it. this should be the 1st thing you replace.
2. overheating. check all fans to make sure they are spinning properly, i would suggest replacing the cpu fan 2nd if the PSU doesn't help.
also i suggest downloading a program called "Motherboard Monitor" and let it monitor your cpu fans and temp etc. its a nice tool for such a matter as this.