How the waves reflect and refract at horizontal layers

Explain how the waves reflect and refract at horizontal layers where velocity increases and where velocity decreases.