Thunder is the acoustic shock wave resulting from the extreme heat generated by a lightning flash. It is produced the same way regardless of whether lightning is positive or negative.
Lightning can be as hot as 54,000°F (30,000°C), a temperature that is five times hotter than the surface of the Sun! When lightning occurs, it heats the air surrounding its channel to that same incredible temperature in a fraction of a second.
Like all gases, air expands when heated. The faster it is heated, the faster the rate of expansion. When air is heated to 54,000°F (30,000°C) in a fraction of a second, a phenomenon known as "explosive expansion" occurs – air expands so rapidly that it compresses the air in front of it, forming a shock wave similar to a sonic boom. Exploding fireworks produce a similar result.
Learning Lesson: The Rumblin' Road: Determining Distance to a Thunderstorm
The temperature of the atmosphere affects the sound of thunder as well as how far it travels.
Sound waves move faster in warm air than in cool air. Typically, the air temperature decreases with height, and thunder will normally have an audible range up to 10 miles (16 km).
However, when the air temperature increases with height, called an inversion, sound waves are refracted (bent back toward the Earth) due to their faster motion in the warmer air. Normally, only the direct sound of thunder is heard. But refraction can add some additional sound, effectively amplifying the thunder and making it sound louder.
This is more common in the winter, when thunderstorms develop in the warm air above a cooler surface air mass.
If the lightning in these "elevated thunderstorms" remains above the inversion, then most of the thunder sound also remains above the inversion. However, many of the sound waves from cloud-to-ground strikes remain below the inversion, giving thunder a much louder impact.