That sounds interesting isn't it?
So why do stars twinkle?
I believe many of us have seen this image when we swim.
The air around us works the same way; it refracts the light that's coming from the sun and other light-emitting celestial bodies. The atmospheric density fluctuates all the time, and this phenomenon leads to atmospheric turbulence, i.e the motion of air in the atmosphere. When the light passes through the Earth's atmosphere, it is refracted by the disturbed air, fooling us into thinking that the distant stars are twinkling.
Well, that is because the sun is relatively closer to us, and thus the intensity is very much higher than distant stars. Therefore any form of atmospheric turbulence will not be enough to make our sun twinkle. On the other hand, the light coming from distant stars are relatively dim and weak. Hence the light could easily be altered by slight atmospheric disturbance.
There is also another factor that could lead to this star-twinkling phenomenon; the distance travel by light in the atmosphere. I think the diagram below sums it all.