The Sun is the star of our Solar System. The Earth and other matter (including other planets, asteroids, meteoroids, comets and dust) orbit the Sun, which by itself accounts for more than 99% of the Solar System's mass. Energy from the Sun—in the form of insolation from sunlight—supports almost all life on Earth via photosynthesis, and drives the Earth's climate and weather.
About 74% of the Sun's mass is hydrogen, 25% is helium, and the rest is made up of trace quantities of heavier elements. The Sun has a spectral class of G2V. "G2" means that it has a surface temperature of approximately 5,500 K, giving it a white color, which because of atmospheric scattering appears yellow. Its spectrum contains lines of ionized and neutral metals as well as very weak hydrogen lines. The "V" suffix indicates that the Sun, like most stars, is a main sequence star. This means that it generates its energy by nuclear fusion of hydrogen nuclei into helium and is in a state of hydrostatic equilibrium, neither contracting nor expanding over time. There are more than 100 million G2 class stars in our galaxy. Because of logarithmic size distribution, the Sun is actually brighter than 85% of the stars in the Galaxy, most of which are red dwarfs.
The Sun is a magnetically active star; it supports a strong, changing magnetic field that varies year-to-year and reverses direction about every eleven years. The Sun's magnetic field gives rise to many effects that are collectively called solar activity, including sunspots on the surface of the Sun, solar flares, and variations in the solar wind that carry material through the solar system. The effects of solar activity on Earth include auroras at moderate to high latitudes, and the disruption of radio communications and electric power. Solar activity is thought to have played a large role in the formation and evolution of the Solar System, and strongly affects the structure of Earth's outer atmosphere.