A star is a massive, luminous ball of plasma. The nearest star to Earth is the Sun, which is the source of most of the energy on Earth. Other stars are visible in the night sky, when they are not outshone by the Sun. For most of its life, a star shines due to thermonuclear fusion in its core releasing energy that traverses the star's interior and then radiates into outer space. Almost all elements heavier than hydrogen and helium were created by fusion processes in 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 are determined by its evolutionary history, including the diameter, rotation, movement and temperature. A plot of the temperature of many stars against their luminosities, known as a Hertzsprung-Russell diagram (H–R diagram), allows the age and evolutionary state of a star to be determined.
A star begins as a collapsing cloud of material composed primarily of hydrogen, along with helium and trace amounts of heavier elements. Once the stellar core is sufficiently dense, some of the hydrogen is steadily converted into helium through the process of nuclear fusion. The remainder of the star's interior carries energy away from the core through a combination of radiative and convective processes. The star's internal pressure prevents it from collapsing further under its own gravity. 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, in some cases 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.