John A. Graham, an astronomer with the Carnegie Institution of Washington, explains.

Have you ever noticed how a coin at the bottom of a swimming pool seems to wobble from side to side? This phenomenon occurs because the water in the pool bends the path of light from the coin. Similarly, stars twinkle because their light has to pass through several miles of Earth's atmosphere before it reaches the eye of an observer. It is as if we are looking up at the universe from the bottom of a swimming pool. Our atmosphere is very turbulent, with streams and eddies forming, churning around and dispersing all the time. These disturbances act like lenses and prisms that shift the incoming light from a star from side to side by minute amounts several times a second. For large objects like the moon, these deviations average out. (Through a telescope with high magnification, however, we see shimmering images.) Stars, in contrast, are so far away that they effectively act as point sources, and the light we see flickers in intensity as the incoming beams bend rapidly from side to side. Planets like Mars, Venus and Jupiter, which appear to us as bright stars, are much closer to Earth and look like measurable discs through a telescope. Again, the twinkling from adjacent areas of the disc averages out, and we see little variation in the total light emanating from the planet.

In outer space, where there is no atmosphere, stars do not twinkle. This is why the Hubble Space Telescope can produce the brilliant and crisp images of the universe that we have come to know. At our Earthbound observatories, we are learning how to compensate for the twinkling effect by adapting the optics of our large telescopes as fast as it occurs. As a result, we should soon be able to produce much sharper images from here on the ground.

Answer originally posted on August 5, 2002.