Headlights working! Then clean the battery posts and cables, and connections at the solenoid.
Still don't work? Swap in your spare solenoid... you do carry a $10 spare, right?
Still no joy? Ignition switch or a bad connection somewhere.
Post up your result.