When a lightning bolt flashes through the sky we see it instantly. The following thunder, the sound of the lightning, takes a few seconds longer to reach us, as light reavels much faster than sound. Thunder never just goes "Boom!" and then stops, rather one hears a loud clap followed by several seconds of rumble. Why does thunder rumble? Lightning heats air to more than 20,000°C, much hotter than the surface of the sun is. The sudden heating causes the air to expand as the flash passes trough the atmosphere and immediate cooling contracts the air again. Quick expansion and contraction of air around lightning starts air molecules moving back and forth, creating sound waves. As this is happening extremely fast we will hear the 'clap' of a thunder.
Now imagine a lightning bolt. They can be several miles long, no matter if it is a cloud to cloud or cloud to ground discharge. Lets say the nearest part of the bolt is one mile away. Sound travels about a mile in 5 seconds, thus you will hear the first part - the clap of the lightning - five seconds after the flash. If the farthest part of the bolt is three miles away, it will take 15 seconds to hear that part of the bolt. From second 5 to second 15 after the flash you will hear every different part (clap) in between, resulting in a rumbling sound. The end of the rumble is the farthest part of the bolt.
Often the thunder gets softer, then louder, then softer, and so on. It makes sense that as one hear parts of the lightning that are farther away that the sound would get softer, just as other sounds are louder when they are near and softer when the source of the sound is farther away. This has to do with the shape of a lightning bolt. Lightning bolts are not straight, rather they "zig zag" forth and back in different angles, towards and away from the observer point.
Related Features:
Thunderstorms
Where Lightning Strikes
Sferics - the observed lightnings - now