Gently singing Twinkle, twinkle, little star may lull a baby to sleep, but beyond the confines of Earth’s atmosphere, the words aren’t exactly accurate. A correct, albeit less soothing, rendition might be: Emit, emit, gigantic ball of gas.

Stars are huge celestial bodies made mostly of hydrogen and helium that produce light and heat from the churning nuclear forges inside their cores. Aside from our sun, the dots of light we see in the sky are all light-years from Earth. They are the building blocks of galaxies, of which there are billions in the universe. It’s impossible to know how many stars exist, but astronomers estimate that in our Milky Way galaxy alone, there are about 300 billion.

A star is born

The life cycle of a star spans billions of years. As a general rule, the more massive the star, the shorter its life span.

Birth takes place inside hydrogen-based dust clouds called nebulae. Over the course of thousands of years, gravity causes pockets of dense matter inside the nebula to collapse under their own weight. One of these contracting masses of gas, known as a protostar, represents a star’s nascent phase. Because the dust in the nebulae obscures them, protostars can be difficult for astronomers to detect.

As a protostar gets smaller, it spins faster because of the conservation of angular momentum—the same principle that causes a spinning ice skater to accelerate when she pulls in her arms. Increasing pressure creates rising temperatures, and during this time, a star enters what is known as the relatively brief T Tauri phase.

Millions of years later, when the core temperature climbs to about 27 million degrees Fahrenheit (15 million degrees Celsius), nuclear fusion begins, igniting the core and setting off the next—and longest—stage of a star’s life, known as its main sequence.

Most of the stars in our galaxy, including the sun, are categorized as main sequence stars. They exist in a stable state of nuclear fusion, converting hydrogen to helium and radiating x-rays. This process emits an enormous amount of energy, keeping the star hot and shining brightly.

All that glitters

Some stars shine more brightly than others. Their brightness is a factor of how much energy they put out–known as luminosity–and how far away from Earth they are. Color can also vary from star to star because their temperatures are not all the same. Hot stars appear white or blue, whereas cooler stars appear to have orange or red hues.

By plotting these and other variables on a graph called the Hertzsprung-Russell diagram, astronomers can classify stars into groups. Along with main sequence and white dwarf stars, other groups include dwarfs, giants, and supergiants. Supergiants may have radii a thousand times larger than that of our own sun.

Stars spend 90 percent of their lives in their main sequence phase. Now around 4.6 billion years old, Earth’s sun is considered an average-size yellow dwarf star, and astronomers predict it will remain in its main sequence stage for several billion more years.

As stars move toward the ends of their lives, much of their hydrogen has been converted to helium. Helium sinks to the star's core and raises the star's temperature—causing its outer shell of hot gases to expand. These large, swelling stars are known as red giants. But there are different ways a star’s life can end, and its fate depends on how massive the star is.

The red giant phase is actually a prelude to a star shedding its outer layers and becoming a small, dense body called a white dwarf. White dwarfs cool for billions of years. Some, if they exist as part of a binary star system, may gather excess matter from their companion stars until their surfaces explode, triggering a bright nova. Eventually all white dwarfs go dark and cease producing energy. At this point, which scientists have yet to observe, they become known as black dwarfs.

Big bang

Massive stars eschew this evolutionary path and instead go out with a bang—detonating as supernovae. While they may appear to be swelling red giants on the outside, their cores are actually contracting, eventually becoming so dense that they collapse, causing the star to explode. These catastrophic bursts leave behind a small core that may become a neutron star or even, if the remnant is massive enough, a black hole.

Because certain supernovae have a predictable pattern of destruction and resulting luminosity, astronomers are able to use them as “standard candles,” or astronomical measuring tools, to help them measure distances in the universe and calculate its rate of expansion.

Looking up

Depending on cloud cover and where you’re standing, you may see countless stars blanketing the sky above you, or none at all. In cities and other densely populated areas, light pollution makes it nearly impossible to stargaze. By contrast, some parts of the world are so dark that looking up reveals the night sky in all its rich celestial glory.

Where Are the Stars? See How Light Pollution Affects Night Skies Of the many ways Earth is polluted, light pollution may be the least talked about. This short film, shot mainly in California by Sriram Murali, goes through all the levels of the scale, showing how the view of the cosmos gets better in less light-polluted areas.

Ancient cultures looked to the sky for all sorts of reasons. By identifying different configurations of stars—known as constellations—and tracking their movements, they could follow the seasons for farming as well as chart courses across the seas. There are dozens of constellations. Many are named for mythical figures, such as Cassiopeia and Orion the Hunter. Others are named for the animals they resemble, such as Ursa Minor (Little Bear) and Canus Major (Big Dog).