A star is a massive, luminous ball of plasma. Stars group together to form galaxies, and they dominate the visible universe. The nearest star to Earth is the Sun, which is the source of most of the energy on Earth, including daylight. Other stars are visible in the night sky, when they are not outshone by the Sun. A star shines because nuclear fusion in its core releases energy which traverses the star's interior and then radiates into outer space. Almost all elements heavier than hydrogen and helium were created inside the cores of stars.
Astronomers can determine the mass, age, chemical composition and many other properties of a star by observing its spectrum, luminosity and motion through space. The total mass of a star is the principal determinant in its evolution and eventual fate. Other characteristics of a star that are determined by its evolutionary history include the diameter, rotation, movement and temperature. A star begins as a collapsing cloud of material that is composed primarily of hydrogen along with some helium and heavier trace elements. Once the stellar core is sufficiently dense, some of the hydrogen is steadily converted into helium through the process of nuclear fusion. Once the hydrogen fuel at the core is exhausted, those stars having at least 0.4 times the mass of the Sun expand to become a red giant, fusing heavier elements at the core, or in shells around the core. The star then evolves into a degenerate form, recycling a portion of the matter into the interstellar environment, where it will form a new generation of stars with a higher proportion of heavy elements.