Refraction is the bending of a wave of light, heat, or sound when it passes from one medium to another.
Refraction occurs because waves travel at different velocities in different media.
The refractive index of a material indicates how much light is bent. Diffraction is the slight spreading of light beam into a pattern of light and dark bands when it passes through a narrow slit or past the edge of an obstruction. The regular spacing of atoms in crystals are used to diffract x-rays, and in this way the structure of many substances has been elucidated. Sound waves can also be diffracted by a suitable array of solid objects.