Sunlight reaches Earth’s atmosphere and is scattered in all directions by all the gases and particles in the air. The visible light rays of sunlight consists of the spectrum of red, orange, yellow, green, blue and indigo light rays. Blue light is scattered more than the other colors because it travels as shorter, smaller waves. The scattered blue light high up in the atmosphere causes the sky to appear blue.
Watch the video to get a better idea!