The twinkling of a star is due to atmospheric refraction of
starlight. The starlight, on entering the earth’s atmosphere,
undergoes refraction continuously before it reaches the earth.
The atmospheric refraction occurs in a medium of gradually
changing refractive index. Since the atmosphere bends
starlight towards the normal, the apparent position of the
star is slightly different from its actual position. The star
appears slightly higher (above) than its actual position when
viewed near the horizon. Further, this apparent
position of the star is not stationary, but keeps on changing
slightly, since the physical conditions of the earth’s
atmosphere are not stationary,