If we look at objects through the hot air over a fire, they appear to be moving or shaking slightly because of the refraction of light. When the air just above the fire gets heated up, it becomes optically rarer than the colder air further above the fire, which is optically denser. Now, when we look at objects over a fire, the light coming from them through two different mediums of different optical densities undergoes refraction, or bending of light, randomly, which makes the objects appear to be moving slightly.