An example of how refraction works is placing a straw in a cup of water, with part of the straw in the water. When looking at a certain angle, the straw appears to bend at the water's surface. This is because of the change in density of the medium and thus, bending of light rays as they move from the air to water.