Where do rainbows come from?
Sometimes when it rains, you can see a rainbow. A rainbow appears only when it is raining and sunny at the same time.
(Photo by Wing-Chi Poon)
Sunlight contains many different colors. Actually, it contains an infinite number of colors, all colors which exist. This is the sunlight's visible spectrum, and it ranges from red to violet. But all of these colors together, as in normal sunlight, appear white. Raindrops separate all the different colors so that one can observe them individually. Therefore a rainbow has all these colors.
The reason for the color separation is that light breaks when it penetrates the droplet of water. To break light means that the light doesn't go straight through the surface of the raindrop; it gets bent. In physics this effect is called light refraction. Each color gets bent to different degrees. In rainbows, the white sunlight gets separated into the individual colors of the spectrum, as shown in the figure below. Then, at the back of the raindrop it gets reflected. While exiting, the light gets broken again. You can see from the diagram that the sun needs to be behind you whereas the rain needs to be in front of you in order to observe the individual colors.
This separation of light happens in all the raindrops of the raincloud, which are at a specific angle between you and the direction of sunlight. All of these different colors form the rainbow.
You can also make a tiny rainbow yourself by spraying water outside on a sunny day with the sun in your back. It looks great.
Figure of the sunlight breaking and reflecting in a raindrop.