The nimble from the star is diverted by the Earth's troposphere. That generates the "twinkle".  

2 3 2
This is due to atmospheric refraction.Due to this the light coming from the stars are refracted by the different layers of earth having different optical density.When atmospheric refraction increases,the light is refracted most and stars appear dim.When atmospheric refraction decrease, light is not refracted much than before so the stars appear bright.This causes twinkling effect.
1 4 1