Thunder is the result of lightning. What causes it?
A lightning bolt is extremely hot. Its temperature can reach as high as 60,000 degrees Fahrenheit. When a lightning bolt materializes, the air it occupies is instantly super-heated. At first, this heated air has no time to expand and so it assumes a much higher pressure. Then, it expands violently like a boxer punching his arms out in all directions at once. Basically, thunder is the sound of that heated, pressurized air suddenly punching the air around it, as it suddenly expands. In fact, the jolt is so rapid, in the first several yards around the lightning channel, there isn't even any sound. There's only a violent shock wave that travels faster than the speed of sound. The thunder is only generated beyond those several yards, as the speed of the shock wave slows.
---David Murphy