The air surrounding a bolt of lightning heats up so rapidly that it forces the air to quickly expand, creating the sound of thunder. Lightning can instantly heat the air to over 48,000 degrees Fahrenheit, which doesn't give the air time to expand naturally.
The shape of a lightning bolt and the ground terrain affect the sound of thunder. Rolling thunder is created when the shock waves of a forked bolt bounce off each other, the nearby terrain and clouds. A single boom of thunder is often the result of a single, vertical bolt. However, not all lightning creates thunder. In 1885, the Washington Monument was struck several times, but observers didn't hear any thunder.