If your lights go out when trying to start then it usually indicates a bad battery/connections but could also be the starter and wiring. How did you test them to be good? A good test is to put a digital voltmeter across the battery and observe the voltage when trying to crank the engine. If the voltage drops below 9 to 10 volts then you probably won't have enough current to crank the engine. The clicking sound could be coming from the starter solenoid not being able to engage the starter due to low current. Check the wiring and again the grounds too.