Rainbow is formed by the dispersion of sunlight.It usually appears after the rain.In the formation of rainbow many phenomenon occurs at a same time. These are as follows :-
When the sunlight is passed through or go into the suspended particles in the atmosphere internal refraction take place and causes a band of seven colours called rainbow.And when these rays come into our eyes we can able to see a rainbow.
Note = A rainbow always forms on the opposite side of the sun.
Here , raindrop acts like a small prism.