Be glad that the 4th light did not come on. Here's what they mean:
LED 1 indicates that trickle voltage from the power supply has been detected. This LED will be ON when the computer is turned off and your power supply is working correctly.
LED 2 indicates that the main logic board has detected proper power from the power supply when the computer is turned on. This LED will be ON when the computer is turned on and the power supply is working correctly.
LED 3 indicates that the computer and the LCD display are communicating. This LED will be ON when the computer is turned on and video signal is being generated.
LED 4 lights only if the computer detects an over-temperature condition. This LED will be OFF when the computer is turned on and running at the correct temperature.
If the machine will boot from the DVD, then it's most likely a hard drive failure. Boot from the DVD, go to the second screen pull down menu, Utilities, Disk Utility and try to run the "Repair". That failing, reformat the drive using the "write zero's" option, this will eliminate any bad blocks. Now try reinstalling the system. This failing, replace the hard drive. Here's how: iMac G5 17" Model A1058 Hard Drive Replacement