When stars first begin to fuse hydrogen to helium, they lie on the zero-age main sequence. The amount of time a star spends in the main-sequence stage depends on its mass. More massive stars complete each stage of evolution more quickly than lower-mass stars. The fusion of hydrogen to form helium changes the interior composition of a star, which in turn results in changes in its temperature, luminosity, and radius. Eventually, as stars age, they evolve away from the main sequence to become red giants or supergiants. The core of a red giant is contracting, but the outer layers are expanding as a result of hydrogen fusion in a shell outside the core. The star gets larger, redder, and more luminous as it expands and cools.
Star clusters provide one of the best tests of our calculations of what happens as stars age. The stars in a given cluster were formed at about the same time and have the same composition, so they differ mainly in mass, and thus, in their life stage. There are three types of star clusters: globular, open, and associations. Globular clusters have diameters of 50–450 light-years, contain hundreds of thousands of stars, and are distributed in a halo around the Galaxy. Open clusters typically contain hundreds of stars, are located in the plane of the Galaxy, and have diameters less than 30 light-years. Associations are found in regions of gas and dust and contain extremely young stars.
The H–R diagram of stars in a cluster changes systematically as the cluster grows older. The most massive stars evolve most rapidly. In the youngest clusters and associations, highly luminous blue stars are on the main sequence; the stars with the lowest masses lie to the right of the main sequence and are still contracting toward it. With passing time, stars of progressively lower masses evolve away from (or turn off) the main sequence. In globular clusters, which are all at least 11 billion years old, there are no luminous blue stars at all. Astronomers can use the turnoff point from the main sequence to determine the age of a cluster.
After stars become red giants, their cores eventually become hot enough to produce energy by fusing helium to form carbon (and sometimes a bit of oxygen.) The fusion of three helium nuclei produces carbon through the triple-alpha process. The rapid onset of helium fusion in the core of a low-mass star is called the helium flash. After this, the star becomes stable and reduces its luminosity and size briefly. In stars with masses about twice the mass of the Sun or less, fusion stops after the helium in the core has been exhausted. Fusion of hydrogen and helium in shells around the contracting core makes the star a bright red giant again, but only temporarily. When the star is a red giant, it can shed its outer layers and thereby expose hot inner layers. Planetary nebulae (which have nothing to do with planets) are shells of gas ejected by such stars, set glowing by the ultraviolet radiation of the dying central star.
In stars with masses higher than about 8 solar masses, nuclear reactions involving carbon, oxygen, and still heavier elements can build up nuclei as heavy as iron. The creation of new chemical elements is called nucleosynthesis. The late stages of evolution occur very quickly. Ultimately, all stars must use up all of their available energy supplies. In the process of dying, most stars eject some matter, enriched in heavy elements, into interstellar space where it can be used to form new stars. Each succeeding generation of stars therefore contains a larger proportion of elements heavier than hydrogen and helium. This progressive enrichment explains why the stars in open clusters (which formed more recently) contain more heavy elements than do those in ancient globular clusters, and it tells us where most of the atoms on Earth and in our bodies come from.