Why the sky is blue
Air molecules scatter short wavelengths far more strongly than long ones. Rayleigh scattering goes as 1/lambda^4, so blue light at 440 nm scatters about 5.7 times as strongly as red light at 680 nm. Blue gets bounced around the atmosphere many times before it reaches your eye, arriving from every direction at once, so the whole sky glows with it. Red light mostly travels straight through.
At sunset the light reaches you along a much longer path through the atmosphere. Most of the blue has been scattered out of it by then, and what is left is the red and orange end of the spectrum.
Mars has a thin carbon dioxide atmosphere carrying a lot of iron-rich dust. Those grains are far larger than air molecules, so they scatter right across the spectrum with a strong red bias, and the Martian day sky settles into a dull butterscotch.
This playground computes the sky color above from the atmosphere you build. Sliders set the proportions of nitrogen and oxygen, carbon dioxide, hydrogen and helium, methane and water vapor, along with surface pressure, dust density, the sun's altitude in the sky and the star's surface temperature. Presets load Earth, Mars, Venus, Titan and Jupiter. Every change re-derives the scattering coefficients, which are listed under the sliders, and the sky redraws from them.
The same scattering model draws the atmospheres and skies inside Luna Space Simulator, a browser gravity sandbox by Ali Karpuzoglu (Watermelonson).