The light from stars undergoes number of refractions before reaching the earth. Due to change in temperature conditions and density of the atmosphere, the star light has to travel through fluctuating masses of air in motion, hence the apparent position of the star constantly keeps on changing. This give rise to twinkling of stars.