Electromagnetic radiation consists of synchronised oscillations (or their quanta, photons) of the electric and magnetic fields, propagating through space at the speed of ~300,000 km/s. Visible light is a certain portion of electromagnetic spectrum between infrared (too weak to excite electrons in molecules) and ultraviolet (powerful enough to cause irreversible chemical reactions in organic matter).
The main source of light on Earth is the Sun. Thermonuclear reactions in it’s core produce high energy gamma-rays that are absorbed and converted into lower energy radiation by ionized atoms in it’s photosphere and chromosphere layers.
After traveling through space for about 500 seconds (8 m 20 s) it reaches the Earth, where the atmospheric gases absorb x-rays, most of UV and some of infrared spectrum. The remainder reaches the surface of the planet being partly scattered by air molecules. This elastic scattering is stronger for light with higher frequencies and results in the blue glow of the sky and red color of the sunsets.