All things considered, our atmosphere is pretty great. This blanket of nitrogen, oxygen and other gases keeps the world's temperature nice and habitable while protecting us from harmful UV radiation — to say nothing of the space debris it vaporizes. Oh yeah, and without all that oxygen in our atmosphere, animal life couldn't survive on planet earth. Not a bad resume.
But despite its many good qualities, the atmosphere can be a nuisance to astronomy buffs. That's because it distorts light. At night, the atmosphere makes some heavenly bodies appear to flicker and shimmer. The technical term for this phenomenon is "astronomical scintillation." You probably know it by a different name: twinkling.
Like an onion, the atmosphere is made up of layers. At the bottom is the troposphere, which starts right here at ground level on the planet's surface. Standing about 5 to 9 miles (8 to 14.5 kilometers) tall, it's where most of Earth's weather events take place. The other layers are — in ascending order — the stratosphere, mesosphere, thermosphere and exosphere. (There's also a region called the ionosphere, which encompasses parts of the mesosphere and thermosphere.)
These layers have different temperatures. In addition, the air's density varies from level to level. When starlight enters our atmosphere, it runs into pockets of cool and warm air. The pockets act as big lenses, causing the light to change direction — or "refract" — as it passes through them. Yet the lenses are not fixed in place; they move around and change shape. As they shift, so does starlight refraction. That's why the stars appear to twinkle.
Scintillation affects planets, too. Mercury, Venus, Mars and other planets in our solar system do twinkle when viewed from Earth on a clear night. (So does our moon.) However, the planets twinkle to a barely noticeable degree.
Distance is the main reason stars twinkle more conspicuously than the planets in our solar system. Because the former are so far away, each star looks like a single pinpoint of light. It's a different story for Earth's moon and our neighboring planets. Being a lot closer, they're less affected by the atmosphere. Planets and moons appear as tiny disks up in the sky. The light they emanate comes not from a single point but from many individual points all clustered together. These rarely scintillate in unison, which is why planets and moons don't twinkle as dramatically as the stars.
Twinkling only can happen when an atmosphere is present. It's for this reason that photos taken by the Hubble Telescope look so clear; there aren't any atmospheric air pockets to refract the starlight. Earthbound astronomers use telescopes with adaptive optics systems to compensate for twinkling, making the stars look more stable.