The transmission of sound can be illustrated by using a model consisting of an array of spherical objects interconnected by springs.
In real material terms, the spheres represent the materials molecules and the springs represent the bonds between them. Sound passes through the system by compressing and expanding the springs, transmitting the acoustic energy to neighboring spheres. This helps transmit the energy in-turn to the neighboring spheres springs (bonds), and so on.
The speed of sound through the model depends on the stiffness/rigidity of the springs, and the mass of the spheres. As long as the spacing of the spheres remains constant, stiffer springs/bonds transmit energy more quickly, while more massive spheres transmit energy more slowly.
In a real material, the stiffness of the springs is known as the "elastic modulus", and the mass corresponds to the material density. Sound will travel more slowly in spongy materials and faster in stiffer ones. Effects like dispersion and reflection can also be understood using this model. 
For instance, sound will travel 1.59 times faster in nickel than in bronze, due to the greater stiffness of nickel at about the same density. Similarly, sound travels about 1.41 times faster in light hydrogen (protium) gas than in heavy hydrogen (deuterium) gas, since deuterium has similar properties but twice the density. At the same time, "compression-type" sound will travel faster in solids than in liquids, and faster in liquids than in gases, because the solids are more difficult to compress than liquids, while liquids, in turn, are more difficult to compress than gases.
Some textbooks mistakenly state that the speed of sound increases with density. This notion is illustrated by presenting data for three materials, such as air, water, and steel and noting that the speed of sound is higher in the denser materials.  But the example fails to take into account that the materials have vastly different compressibility, which more than makes up for the differences in density, which would slow wave speeds in the denser materials.  An illustrative example of the two effects is that sound travels only 4.3 times faster in water than air, despite enormous differences in compressibility of the two media. The reason is that the greater density of water, which works to slow sound in water relative to the air, nearly makes up for the compressibility differences in the two media.
A practical example can be observed in Edinburgh when the "One oClock Gun" is fired at the eastern end of Edinburgh Castle. Standing at the base of the western end of the Castle Rock, the sound of the Gun can be heard through the rock, slightly before it arrives by the air route, partly delayed by the slightly longer route. It is particularly effective if a multi-gun salute such as for "The Queens Birthday" is being fired.