The colors of the sunset result from a phenomenon called scattering. Molecules and small particles (dust particles, soot particles, other solid aerosols, and liquid aerosols) in the atmosphere change the direction of light rays, causing them to scatter. Scattering affects the color of light coming from the sky, but the details are determined by the wavelength of the light and the size of the particle.
The short-wavelength blue and violet are scattered by molecules in the air much more than other colors of the spectrum and they reach our eyes during the day. As we can't see violet very well, the sky appears blue.
When the sun is low on the horizon, sunlight passes through more air at sunset and sunrise than during the day, when the sun is higher in the sky. If the path is long enough, all of the blue and violet light scatters out of your line of sight. The other colors continue on their way to your eyes. This is why sunsets are often yellow, orange, and red. And because red has the longest wavelength of any visible light, the sun is red when it’s on the horizon, where its extremely long path through the atmosphere blocks all other colors.
Sunset colors are typically more brilliant and more intense than sunrise colors. Sunrise color intensities can however exceed sunset's intensities when there are nighttime fires, volcanic eruptions or emissions, or dust storms to the east of the viewer.
After sunset comes the moment at which darkness falls - the dusk. The period between the sunset and dusk is called twilight.