Solar panels produce the best results under direct sunlight but they can still generate electricity during cloudy and rainy days, just not that efficiently. Even under mins sunlight, a significant amount of power can be produced by solar panels, but the energy output compared to bright sunny days will be lower.