Cannot travel in vaccum. Sound is energy and it causes vibration, which travels in a medium. So imagine molecules transfering the energy (vibration) from source toward a particular direction. In water molecules are more rigid than in gas. So vibration is transferred faster.