On those hot days, the pavement does a great job of absorbing the energy from the sun. As the heat radiates away, it causes a layer of very hot air near the surface. Air becomes less dense as it becomes warmer, and light can change direction and speed when it enters an area of changing density.
Much like how things appear different at the bottom of a pool than usual, the light bends as it passes between the areas of changing density to create the shimmering effect. It's similar physics that creates mirages.
For More Information: