Rainbow is formed by the dispersion of sunlight by tiny water droplets present in the atmosphere. A rainbow is always formed in a direction opposite to that of the Sun. The water droplets act like small prisms. They refract and disperse the incident sunlight, then reflect it internally, and finally refract it again when it comes out of the raindrop.