Theory:

In the previous section, we have seen that white light is dispersed into its seven-colour elements by a prism.
 
Why do we get these colours?
 
When the light rays travel through a prism, different colours of light bend through different angles with respect to the incident ray. The red light bends the shortest while the violet the most. Thus, each colour's rays emerge along different paths and thus become distinct. It is the band of different colours that we see in a spectrum.
 
Isaac Newton was the first scientist to use a glass prism to get the spectrum of sunlight. He further attempted to split the colours of the spectrum of white light by using another similar prism. But, he could not notice any more colours. He then located a second identical prism in an inverted position with respect to the first prism, as shown in the figure. This enabled all the colours of the spectrum to travel through the second prism. He noticed a beam of white light emerging from the other side of the second prism. This investigation gave Newton the idea that the sunlight comprises seven colours.
 
SCEN10053118.png
Recombination of the spectrum of white light
 
Any light that provides a spectrum similar to sunlight is often considered as white light.
 
A rainbow is a natural spectrum that appears in the sky following a rain shower (Shown in the figure). The dispersion of sunlight causes it by tiny water droplets present in the atmosphere.
 
rainbow-g704889562_1920.jpg
Rainbow in the sky
 
A rainbow is continually set in a direction opposite to that of the Sun. The water droplets behave like small prisms. They get refracted and disperse the incident sunlight, then internally it gets reflected, and finally, get refracted again when it comes out of the raindrop (shown in the figure). Different colours reach the observer due to light and internal reflection dispersion. You can also be able to see a rainbow on a sunny day when you look at the sky through a waterfall or a water fountain, with the Sun behind you.
 
Rainbow_formation.png
Rainbow formation
 
Legend:
  1. Spherical droplet
  2. Places where an internal reflection of the light occurs
  3. Primary rainbow
  4. Places where refraction of the light occurs
  5. Secondary rainbow
  6. Incoming beams of white light
  7. Path of light contributing to primary rainbow
  8. Path of light contributing to secondary rainbow
  9. Observer
  10. The region forming the primary rainbow
  11. The region forming the secondary rainbow
  12. Zone in the atmosphere holding countless tiny spherical droplets