Gases:

The speed of sound depends upon the properties of the medium it is passing through. When we look at the properties of a gas, we see that only when molecules collide with each other can the condensations and rarefactions of a sound wave move about. So, it makes sense that the speed of sound has the same order of magnitude as the average molecular speed between collisions. In a gas, it is particularly important to know the temperature. This is because at lower temperatures, molecules collide more often, giving the sound wave more chances to move around rapidly. At freezing (0º Celcius), sound travels through air at 331 meters per second (about 740 mph). But, at 20ºC, room temperature, sound travels at 343 meters per second (767 mph).

Liquids:

Sound travels faster in liquids than in gases because molecules are more tightly packed. In fresh water, sound waves travel at 1,482 meters per second (about 3,315 mph). That's well over 4 times faster than in air! Several ocean-dwelling animals rely upon sound waves to communicate with other animals and to locate food and obstacles. The reason that they are able to effectively use this method of communication over long distances is that sound travels so much faster in water.

Solids:

Sound travels fastest through solids. This is because molecules in a solid medium are much closer together than those in a liquid or gas, allowing sound waves to travel more quickly through it. In fact, sound waves travel over 17 times faster through steel than through air. The exact speed of sound in steel is 5,960 meters per second (13,332 mph)! But, this is only for the majority of solids. The speed of sound in all solids are not faster than in all liquids.