The sound we hear comes from the intensive heat of the lightning on the surrounding air molecules.
The heat may be up to 30,000 degrees Centigrade, which causes an atmosphere pressure increase in the immediate vicinity that is up to 100x normal.
The abrupt rise in heat causes expansion of the air molecules, creating a sound (acoustic) waves that initially travel faster than the speed of sound. Surrounding air molecules absorb this shock wave of energy, slow it down and decrease its amplitude. The subsequent rumbling sound is the bouncing of these sound waves off the clouds and the ground. If the lightning is far off, it will sound as a rumble as well, due to the reflection and attenuation of the sound wave by the air.