The atmosphere consists of a number of parallel layers of air varying densities. The most dense layer is near the surface of earth &least dense layer is the top most layer .When the rays of light coming from this stars pass through atmosphere of varying densities they bend towards the normal .Finnaly when the refracted rays of light reach the eye , the eye traces straight line path.due yo this fluctuations of refractive index of layers stars apper twinkling
Stars are twekiling because the atoms in the air which are floatingĀ are coming in front of stars sec by sec so we see the stars twenkling