The Earth’s atmosphere is a layer of gases that surrounds the Earth and is retained by the force of gravity. Earth’s atmosphere protects life on Earth by absorbing solar ultraviolet radiation, reducing the intensity of cosmic rays and heating the surface by retaining heat, reducing the temperature extremes between day and night. Seen from space, the planet Earth appears as a bright blue-colored sphere. This chromatic effect is produced by the dispersion of sunlight over the atmosphere.
Source