To create atmospheric optics we need two things ... the light bends and that’s when you get the rainbow. An example of refraction is a pencil in a glass of water. The pencil appears to bend.