Rayleigh scattering is a phenomenon that occurs when light interacts with small particles in the atmosphere. It explains why the sky appears blue during the day. When sunlight passes through the atmosphere, shorter wavelengths of light, like blue, are scattered more than longer wavelengths, such as red. This scattering causes the blue light to spread across the sky.
In addition to explaining the color of the sky, Rayleigh scattering also affects the appearance of sunsets. During sunset, the sunlight travels through a thicker layer of the atmosphere, scattering the shorter wavelengths and allowing the longer wavelengths, like red and orange, to dominate the view.