When a wave or light ray moves from one medium to another its speed changes. The direction of the ray may also change. This property of waves is called refraction and commonly occurs with light rays.
It is refraction that makes some objects appear ... This is because one side of the light ray enters the glass first and slows down while the other side is still in the air, so is moving faster ...