Definition
A rainbow is an optical effect. Sunlight enters countless tiny water droplets floating in the air, and the light bends and reflects inside them, splitting into different colors. The colors hidden in seemingly clear sunlight, from red to violet, bend at different angles as they pass through the droplets and then reach your eyes.
A Three-Step Journey Through a Raindrop
After the rain stops, the air is full of tiny water droplets. When sunlight from behind you enters a droplet, its speed changes at the boundary between air and water, and its path bends. This is called refraction.
The light that enters the droplet doesn't just pass straight through. It hits the inner wall at the back of the droplet and bounces back inside, like a mirror. This is reflection inside the droplet. Some of the light escapes out the back, but the light that bounces back heads toward the front of the droplet.
Finally, as the light exits through the front of the droplet into the air, it bends one more time. So light goes through three steps inside a droplet: refraction, reflection, refraction. By the time it reaches your eyes, the hidden colors in the light are finally spread out for you to see.
Why Is Red Always on the Outer Top?
Sunlight looks like one color, but it is actually a mix of every color, from long-wavelength red light to short-wavelength violet light. When light goes from air into a water droplet, each color bends at a different angle.
Short-wavelength violet light bends sharply as it passes through a droplet, while long-wavelength red light bends more gently. This spreading of light into different angles by color is called dispersion.
Of the light coming out of one droplet, red light makes an angle of about 42 degrees with the sun's rays, and violet light makes about 40 degrees. From droplets high in the sky, the red light bending downward reaches your eyes. From droplets a little lower, the violet light reaches you. That is why red appears on the outer, upper edge.
A Closer Look: A Rainbow Is Really a Full Circle
From the ground, a rainbow usually looks like a half-circle arch. That is only because the horizon and the ground block your view of the lower half. If you fly high in an airplane or look down from a mountaintop, you can see a complete, round rainbow.
A rainbow is also not a physical object hanging at a fixed spot in the sky. It is light arriving from directions about 40 to 42 degrees away from an imaginary line running from the sun through your eyes. So when you walk, the rainbow moves with you, and no matter how far you chase it, you can never reach its end.
Sometimes you can see a second, fainter rainbow outside the main one, called a double rainbow. This happens when light is reflected twice inside the droplet. With one extra reflection, the order of colors flips, so red is on the inside and violet is on the outside.
Common misconceptions
A rainbow is a physical arch hanging at a fixed spot in the sky.
A rainbow is an optical effect that forms in your eyes, depending on where you stand and where the sun is. Its true shape is a full circle, and when you move, the rainbow moves with you.
The second rainbow in a double rainbow has the same color order as the first.
The outer, secondary rainbow forms when light reflects twice inside the droplets, so its colors are flipped: violet is on top and red is on the bottom.
Where you meet it
Right after the rain clears, turn your back to the sun and look at the sky. A vivid rainbow often appears.
Spray a garden hose in a fine mist with the sun behind you, and you can make a palm-sized rainbow.
On a bright sunny day, stand with your back to the sun and look at a waterfall. Rainbows often appear in the spray.
In one sentence
A rainbow is what you see when water droplets in the air refract, reflect, and disperse sunlight, spreading it out into many colors.