As sunlight passes through the atmosphere, shorter wavelengths of light (blue and violet) are scattered in all directions by the molecules and particles in the air. However, during sunset, the sun is lower on the horizon, and the light must pass through more atmosphere. This causes the shorter wavelengths to scatter even more, leaving the longer wavelengths (reds and oranges) to dominate, creating the vibrant colors we associate with dusk.