Sunlight enters a raindrop, refracts and disperses into colors, reflects internally, then exits at different angles to form a rainbow.
A rainbow is created when sunlight enters spherical raindrops and undergoes a sequence of optical phenomena: refraction (bending at the air-water interface), dispersion (wavelength-dependent bending that separates colors), internal reflection at the back of the drop, and a second refraction upon exiting. Each color emerges at a slightly different angle, producing the characteristic arc.
D. R. Lide (Ed.), CRC Handbook of Chemistry and Physics, 84th Edition. CRC Press, 2003-2004. J. D. Walker, "Multiple rainbows from single drops of water," American Journal of Physics, vol. 44, no. 5, pp. 421-433, 1976. Kopp, G., & Lean, J. L. (2011). A new, lower value of total solar irradiance. Geophysical Research Letters, 38(1), L01706. Serway, R. A., & Jewett, J. W. (2018). Physics for Scientists and Engineers (10th ed.). Cengage Learning. Hecht, E. (2017). Optics (5th ed.). Pearson.