The formation of a rainbow and the splitting of light when it passes through a prism are examples of refraction. A pencil placed in a beaker of water looks bent due to refraction of light.
When light travels from one medium to another medium, it bends a little. This bending of light is called refraction. A medium can be a solid, a liquid or a gas. The amount by which light bends depends on the properties of the medium. Refraction of white light through a prism is called dispersion of light, and it clearly shows that light is made up of seven colors. Sound waves undergo refraction, as well.