The higher the density of the medium (material)= then the slower the wave (E..G A wave moving from a less dense medium like air to a more dense medium like glass, the wavelength will be slower.
If the wave is travelling perpendicular to the boundary, like the two materials, then it will continue straight on.
However if a wave hits at an angle, it will be refracted (its direction will change)- if its passing into a more dense medium. it will bend towards the normal.