While solar panels only produce electricity when the sun is shining, you can store excess power generated during the day in battery storage systems for use during the night or cloudy days. You can also get credit for excess power produced through net metering.