Well if it can't get past the RAM test, that where I would start.
Will it boot all the way up? It so go under the Apple to about this Mac> Memory and see if it is seeing what's installed. If it is not seeing all of it, reseat the RAM.
Next open it up and blow it out. If it is heavy on the dust, remove the fans and clean the vents. Here's how:
MacBook Unibody Model A1342 Fan Replacement
Now boot the Mac with the back off and insure that the fan is running.
If it is still running hot we need to look at the heat sink and thermal paste replacement. This model uses a liquid filled heat sink that can develop a leak. So when you go to replace the paste look on the logic board for traces of an oily looking stain. If you find it, replace the heat sink.
MacBook Unibody Model A1342 Heat Sink Replacement
How to Apply Thermal Paste
Arctic Silver Thermal Paste