Although thunder and lightning occur at the same time, the lightning is seen before the thunder is heard because light travels at a much faster speed than sound. Sound waves can also bounce off molecules in the air, causing it to travel in different directions. This accounts for the distorted rumbling sound of distant thunder while thunder that is close by can be heard as a loud crack or booming sound.
Lightning travels at a speed of 300,000,000 meters per second, which is about 186,000 miles per second. The speed of sound, in dry air, is about 1 mile every 5 seconds. Since dry air is not common during a thunderstorm, the speed at which thunder travels is only an approximation, but a rough calculation can still be made of the distance of a thunderstorm by comparing the time factors of lightning and its accompanying thunder. Because the speed of light is so fast, the travel time for lightning in the case of a thunderstorm's relatively close distance can be considered instantaneous. Thus, counting the elapsed time in seconds between the flash of lightning and the following thunder, and then dividing that number by 5, will provide the distance in miles. If, for example, 10 seconds pass between the lightning and the thunder, the storm is 2 miles away.