Rainbows do not 'produce' light. Classic rainbows appear whenever the sun is visible and there are small raindrops in the sky in the direction opposite the sun.
Imagine a ray from the sun hitting a drop that is directly above the spot that is opposite the sun. The sun's ray will enter the drop and, if the angle is right, bounce off the back of the drop and come out deflected by a characteristic angle, the "rainbow angle". If the drop is the right number of degrees above the antisolar point, the ray will will bounce off the back of drop and travel to your eye. You will thus see reflected sunlight that appears to be coming from a point that is above the the antisolar point by an angle equal to the rainbow angle.