Rainbow is caused due to:
Dispersion of sun light from water drops
The phenomenon of the splitting up of white light into its component colours is dispersion. It occurs because different colours in white light undergo different extents of refraction. Dispersion of sunlight occurs when white light breaks into its component spectrum of colours as it passes through the rain drops. This natural phenomenon forms a Rainbow.