rainbows appear whenever the sun is visible and there are small raindrops in the sky in the direction opposite the sun. that's why rainbow often appears after rain, because there still has some raindrops in the air, while the sun shining. At any point between the Sun and the water droplets in the air, different wavelengths of light will strike that spot from different droplets. As the angle changes between the observer and the water droplets, so does the frequency of the reflected light, and therefore, the color. That is why rainbows are curved, or circular.
The most spectacular rainbow displays happen when half of the sky is still dark with raining clouds and the observer is at a spot with clear sky in the direction of the Sun. The result is a luminous rainbow that contrasts with the darkened background.
The rainbow effect is also commonly seen near waterfalls. The effect can also be artificially created by dispersing water droplets into the air during a sunny day.
ccasionally, a second, dimmer, and thicker secondary rainbow is seen outside the primary bow. Secondary rainbows are caused by a double reflection of sunlight inside the raindrops, and appear at an angle of 50°–53°. As a result of the second reflection, the colours of a secondary rainbow are inverted compared to the primary bow, with blue on the outside and red on the inside. The dark area of unlit sky lying between the primary and secondary bows is called Alexander's band, after Alexander of Aphrodisias who first described it.
A third, or tertiary, rainbow can be seen on rare occasions, and a few observers have reported seeing quadruple rainbows in which a dim outermost arc had a rippling and pulsating appearance. These rainbows would appear on the same side of the sky as the Sun, making them hard to spot. One type of tertiary rainbow carries with it the appearance of a secondary rainbow immediately outside the primary bow. The closely spaced outer bow has been observed to form dynamically at the same time that the outermost (tertiary) rainbow disappears. During this change, the two remaining rainbows have been observed to merge into a band of white light with a blue inner and red outer band. This particular form of doubled rainbow is not like the classic double rainbow due to both spacing of the two bows and that the two bows share identical normal colour positioning before merging. With both bows, the inner colour is blue and the outer colour is red.Higher-order rainbows were described by Felix Billet (1808-1882) who depicted angular positions up to the 19th-order rainbow. A pattern he called “rose”. In the laboratory, it is possible to observe higher-order rainbows by using extremely bright and well collimated light produced by lasers. A sixth-order rainbow was first observed by K. Sassan in 1979 using a He Nelaser beam and a pendant water drop. Up to the 200th-order rainbow was reported by Ng et al. in 1998 using a similar method but an argon ion laser beam
information taken from: Wikipedia