A medium is known as denser if the velocity of ray in that phase is fewer than the speed of the wave in other phase.
In comparison to air velocity of sound is main in water, as water is rarer phase for sound waves w.r.t. air. But it is not right for light (EM-waves). For light rays water is denser medium w.r.t. air.