Solution: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. Since the stars are very distant, they approximate point-sized sources of light.
As the path of rays of light coming from the star goes on varying slightly, the apparent position of the star fluctuates and the amount of starlight entering eye flickers the star sometimes appear brighter and sometimes fainter, which is twinkling effect.