Why do stars twinkle?
Since no astronaut while traveling in space has reported seeing stars twinkling, the effect must be atmospheric, i.e. due to air.
However, it is not exactly correct to say that it is due to turbulence in the air.
Mere turbulence in the air is just what we call wind. Wind does not make stars twinkle, because light travels at a great speed --- over 1 billion km/h.
What distorts the light coming from a star is temperature variations in the air. As you probably know already, air temperature varies a great deal. It typically decreases by 6.5 degrees Celsius for every kilometre you go up, and this accords with the experience that it feels cooler up in the mountains. Also, on a hot day, you may notice the shimmering waves (thermals) that come off a heated road and make a distant car appear wavy.
But exactly how do temperature variations cause twinkling?
When light enters a transparent medium, such as air, it generally changes direction, i.e. it is scattered. By how much it changes direction, i.e. bent, however, depends on the temperature.
Now any star, except the sun, is so far away that practically, it is sending only a single ray of light towards us. As that ray enters the atmosphere, it is scattered differently as it passes through air of different temperatures. When it is scattered away from us, the star seems to disappear for a moment. When it is scattered into our eyes, it seems to reappear, resulting in a twinkle.
For more details, please click here to read the article written by Hong Kong Observatory.
(Information provided by Hong Kong Observatory)