A rainbow is an optical phenomenon produced when sunlight interacts with water droplets in the atmosphere, usually in the form of rain, mist or spray. The familiar primary rainbow results from a combination of refraction, wavelength dependent dispersion, internal reflection and a second refraction as light enters, travels through and leaves individual droplets. Sunlight is approximately white because it contains a broad range of visible wavelengths.
When sunlight enters a spherical water droplet from air, its direction changes because light travels at a different speed in water than in air. This change in direction is refraction. Different wavelengths are refracted by slightly different amounts because the refractive index of water depends on wavelength. This wavelength dependence is called dispersion. The separated colours then undergo internal reflection at the back of the droplet and are refracted again as they leave. The resulting rays can reach an observer at particular angles, producing the coloured arc of a rainbow.
The primary rainbow is associated with light that undergoes one internal reflection inside each raindrop. For a typical observer, the most intense rays from the primary rainbow emerge at angles of roughly 40 to 42 degrees from the direction opposite the Sun, with the exact angle varying by wavelength.
Red light generally appears on the outer edge of the primary rainbow and violet on the inner edge because the refractive index of water is higher for shorter wavelengths, causing violet light to deviate more strongly than red light. The precise optical geometry can be understood using Snells law, which relates the angles of incidence and refraction to the refractive indices of the two media. Not every ray entering a droplet contributes equally to the visible rainbow. A concentration of rays emerges near the angle where the deviation changes relatively slowly with incoming direction, producing an intensity enhancement known as the rainbow caustic.
A rainbow is not located at a fixed physical distance or position in the sky. Its apparent position depends on the observer, the Sun and the water droplets. For a rainbow to be visible, the Sun generally needs to be behind the observer and relatively low enough in the sky for the required geometry to place the rainbow above the horizon.
The centre of the rainbow corresponds to the antisolar point, the point in the sky directly opposite the Sun from the observers perspective. From the ground, the horizon often blocks the lower part of the circular geometry, making the rainbow appear as an arc. From a sufficiently elevated viewpoint, such as an aircraft, a full circular rainbow can sometimes be observed because more of the geometric circle is visible. Moving the observer changes the set of droplets that send the appropriate rays towards the observer, so the rainbow effectively moves with the observer.
The colours of a rainbow arise from dispersion rather than from different colours being physically contained as separate bands within each individual droplet before illumination. White sunlight enters each droplet as a mixture of wavelengths. Because the refractive index of water varies with wavelength, each wavelength follows a slightly different path through the droplet and emerges at a different angle. A single droplet can therefore send different colours towards different directions.
An observer sees a particular colour from a particular group of droplets whose geometry sends that wavelength into the observers eyes. A neighbouring direction corresponds to another wavelength and therefore to different droplets. The rainbow is consequently a geometric and spectral effect created by a huge population of droplets rather than a painted or solid object suspended in the atmosphere.
Secondary rainbows can occur when sunlight undergoes two internal reflections inside a droplet before emerging. The additional internal reflection changes the angular distribution of the outgoing light and reverses the order of the colours compared with the primary rainbow. In a secondary rainbow, red is generally on the inner side and violet on the outer side. Secondary rainbows are fainter because additional reflection and transmission processes reduce the intensity reaching the observer.
The region between the primary and secondary rainbows can sometimes appear relatively bright or dark depending on the angular redistribution of light by droplets. This is related to the broader optical structure known as Alexanders band. Multiple internal reflections can also produce additional, much fainter rainbow features under favourable conditions.
Rainbows are affected by droplet size, droplet shape, illumination and atmospheric conditions. Large spherical raindrops tend to produce relatively vivid and well separated colours, while very small droplets can produce broader and less saturated phenomena such as fogbows. A fogbow often appears whitish because the angular width and wave effects associated with small droplets reduce the distinct separation of colours.
Spray from waterfalls and fountains can also create rainbows because the optical requirement is the presence of suitably positioned water droplets rather than rain specifically. Real raindrops are distorted by air resistance as they fall, especially when large, so they are not always perfect spheres. Nevertheless, the spherical approximation is highly effective for explaining ordinary rainbows.
Rainbow formation demonstrates both geometrical optics and aspects of wave optics. Refraction and reflection can explain the principal angular structure using rays, while interference and diffraction become important for fine details and for phenomena involving very small droplets. The supernumerary bands sometimes visible inside a primary rainbow are not fully explained by simple geometric ray tracing and arise from wave interference.
The intensity and exact appearance of rainbows therefore depend on the wave nature of light as well as on classical ray geometry. This makes the rainbow a useful natural example of how multiple optical principles operate together. The phenomenon also shows why the spectrum of white light can become spatially separated without requiring a physical prism.
The historical scientific explanation of rainbows developed alongside the understanding of refraction and the nature of light. Isaac Newton famously used prisms to demonstrate that white sunlight can be dispersed into a spectrum of colours, helping establish that colour is associated with different components of light rather than being created solely by the prism. Later developments in wave optics and electromagnetic theory provided deeper explanations of dispersion, interference and diffraction.
Modern rainbow theory can be described using electromagnetic scattering by spherical particles and solved with increasingly sophisticated mathematical methods when detailed intensity patterns are required. The ordinary rainbow remains visually simple but physically rich because its appearance results from refraction, dispersion, reflection, geometry, wave interference and human visual perception operating together.