A rainbow is one of nature’s most reliable magic tricks. Whenever the Sun shines through falling rain at the right angle, a band of colors arches across the sky. The trick is what happens inside each tiny raindrop.
White sunlight is actually a mix of every visible color - red, orange, yellow, green, blue, indigo, violet. When light enters a raindrop, the drop bends the light a little, like a tiny prism. Different colors bend by slightly different amounts: red bends least, violet bends most. After the light bounces off the back of the drop and exits, the colors separate into a clear spectrum. Millions of raindrops doing this at once produce the full curved rainbow you see.
A rainbow always appears in the part of the sky opposite the Sun. If the Sun is behind you and rain is in front, you’ll see one. They form a circle, but most of the time the bottom half is below the horizon, so you only see the arch. From an airplane, you can sometimes see a full circular rainbow. And here’s a curious detail: each person’s rainbow is technically unique, made from different raindrops based on each viewer’s exact eye position.