Lightning is a static-electric discharge in the atmosphere. This discharge can happen with in the clouds, or between the clouds and the ground. Lightning can heat the air to 30,000°C, which causes the air around it to expand explosively, and the shock wave becomes a sound waves called thunder. Lightning is seen instantly, while thunder travels more slowly. The closer to the storm you are, the louder the sound. Thunder from storms farther away becomes more of a series of rumbles as it bounces off barriers (buildings, trees, etc.) and dissipates over distances.
Watch this slow-motion video of lightning in the night sky.