A rainbow forms when sunlight passes through water droplets in the air. Each droplet bends, reflects, and separates the light into colors, a process called dispersion.
Why the colors appear in an arc
The rainbow shape comes from the angle at which light leaves many droplets and reaches your eyes. You see only the droplets that send the separated light back toward you at the right angle.
When rainbows are easiest to see
Rainbows are most visible when the Sun is behind you and rain or mist is in front of you. A lower Sun often makes a larger, clearer arc.
Rainbows show how white light contains many colors, which is also why the color of the blue sky depends on light scattering.