Lightning that strikes the earth consists of one or more electrical discharges called strokes. The bright light that we see in a flash of lightning is called a return stroke. Air heated by return strokes expands quickly producing wave of pressure called thunder. Prehistoric people thought that thunder was the sound of the gods roaring in anger. Today we know that thunder is caused by the violent expansion of air that has been heated by lightning.
Air is heated instantly when an electric charge of lighting passes through it.
The heat causes the molecules of air to expand, or fly out, in all directions. As the molecules seek more room, they collide violently with layers of cool air, and set up a great air wave that has the sound of thunder. Thunder has many different sounds. The deep rumbling roar of thunder is caused by the air wave from the lightning trunk that is farthest away. The sharp crackle of thunder is set up when the large trunk of lighting forks out into many branches.