Thunder is caused by the rapid expansion of the air surrounding the path of a lightning bolt.
Thunder is caused by lightning. When a lightning bolt travels from the cloud to the ground it actually opens up a little hole in the air. Once then light is gone the air collapses back in and creates a sound wave that we hear as thunder.