If you've got a dynamo hub there are various devices that give you charging options (B&M Luxos builds it into a light, USB-Werk and E-Werk are standalone), while if you haven't, add-on batteries are good and cheap. I've got a couple from Anker with different capacities, while others have been recommended here in posts passim.