Speed of sound in a medium is given as v=ρB… (i)
where, B is the bulk modulus and ρ is the density of the medium.
Since, solids and liquids are much more difficult to compress than gases, so they have much higher values of bulk modulus.
Also, generally solids and liquids have higher mass densities ( ρ) than gases.
But corresponding increase in both the modulus B of solids and liquids is much higher. So, in accordance to Eq. (i), we can say that sound waves travel faster in solids and liquids.
Therefore, Assertion and Reason are correct but Reason is not the correct explanation of Assertion.