The lights will work even if the battery is way too discharged to turn the starter properly. It may not be charging because the battery is knackered or it may be poor connections at the battery or at the ground. Charge the battery, clean the terminals and clamps with a battery brush, and clean the ground connection with sandpaper (the other end of the negative cable).
If it still won't charge, check that the alternator is putting out around 14.5 volts when the engine is running. If all that checks out and it still won't charge, it's probably the battery that needs replacing.