The colors of the rainbow (are so pretty in the sky, thank you Israel Kamakawiwo’ole) but they are also Red Orange Yellow Green Blue Indigo and Violet. You may remember Roy G Biv from elementary science classes. This is the visual spectrum of white light which is primarily emoted from the sun. On a typical sunny day you see all these colors mixed together as white light, but when this light interacts with a raindrop, then you can see it broken down in its individual colors.
Sunlight entering a rain drop goes through refraction, reflection, and dispersion inside the raindrop. The light is reflected back to your eye and the water in the drop impacts each color of the white light a little differently. This allows the light to separate into it’s individual colors and appear as a rainbow. Notice in the picture there is a fainter rainbow just above the bright rainbow. This is due to the light being reflected two times inside the raindrop, creating a fainter bow with the colors reversed.
So we need rain and sunshine for a rainbow, but you also need the sun to be low enough in the sky to create the bow high enough for you to see. This type of weather typically happens with pop up showers or storms late in the afternoon on a spring or summer day. If you ever notice a brief heavy shower followed by bright sunshine then you just might be able to witness one. Head out side (as long as there are not storms nearby) and stand with the sun to your back. If that rainfall is in the right place then you might just be looking at a rainbow.