This is due to a phenomenon called Rayleigh scattering. Sunlight is made up of all the colors of the rainbow. When sunlight enters the Earth's atmosphere, it collides with gas molecules. Blue light waves are shorter than other colors, so they scatter more easily. This scattered blue light reaches our eyes from all directions, making the sky appear blue.