A rainbow is caused by the dispersion of sunlight by tiny water droplets present in the atmosphere, which can be seen after the rain.