When a wave encounters a change in the material in which it propagates, wave scattering will occur at that boundary. The way in which waves scatter at a boundary is determined by boundary conditions.
In two or three dimensions, the angle an incident wavefront makes with a large smooth reflecting surface (over several wavelengths in all directions) is equal to the angle of reflection (specular reflections).
A sudden or progressive change in wave speed will produce a change in propagation direction or a “bending” of the waves. This is known as refraction.