Look up at two in the afternoon and the sky is blue. Look up again three hours later and that same sky is burning orange, red, and pink.
Nothing swapped out. Same sun, same air, same you standing in the same yard. The only thing that changed is the route sunlight takes to reach your eyes, and that turns out to change everything.
Sunlight Is Not Just One Color
Sunlight looks white, but it is a lie of a color. It is every color at once, jammed into one beam. A rainbow that has not been unpacked yet.
Red, orange, yellow, green, blue, indigo, violet. Each one travels as a wave, and the waves are not the same size. Red and orange have long, lazy waves. Blue and violet have short, tight ones. That size difference is the entire reason the sky does what it does.
The Air Is Not Empty
The sky looks like nothing is up there. It is actually packed with molecules, way too small to see, and sunlight is smashing into them nonstop the whole way down.
When light hits one of those molecules, some of it scatters, which just means it ricochets off in a new direction instead of continuing straight. And here is the key: short waves scatter much more easily than long ones. Blue bounces. Red mostly plows through.
So during the day, blue light gets flung all over the atmosphere and then arrives at your eyes from every direction at once. That is not the sun you are seeing when you look at empty sky. That is scattered blue light coming from everywhere.
So Why Isn't the Sky Purple?
Excellent question, because violet scatters even harder than blue. Three things gang up on it. The sun puts out less violet to begin with, some of it gets absorbed high in the atmosphere, and your eyes are simply much more sensitive to blue than to violet.
Violet is up there doing its part. Blue just wins the vote.
What Changes at Sunset?
At sunset the sun drops low, so its light is no longer coming straight down at you. It is coming in sideways, which means it has to cut through a much longer stretch of atmosphere to reach you.
Picture a flashlight pointed down through a glass of water versus pointed sideways through the long way. Way more material to cross. Along that longer path, nearly all the blue gets scattered off somewhere else before it ever reaches you. What survives the trip is red, orange, and yellow, which is exactly what you see.
Why Are Some Sunsets Extra Colorful?
Some sunsets are forgettable. Some make everyone in the neighborhood stop and pull out a phone. The difference is usually whatever is floating around up there. Dust, water droplets, smoke, and pollution all change how the light bounces.
Clouds pull double duty as projection screens. With the sun low, red and orange light hits the undersides of clouds and sets them glowing. Which is why the best sunsets often show up right after a storm, when the air is clean and the sky still has some clouds hanging around.
The Big Idea
The sky is blue because blue scatters easily and comes at you from all directions. Sunsets go orange because low-angle light crosses so much more air that the blue is stripped out before it arrives.
