When granular materials deform under external stress the deformation is often localized into narrow regions. These shear zones act as internal slip surfaces between solid-like blocks of the bulk. The formation of shear zones is a crucial deformation mechanism in fine powders, sand and soil (landslides). Geological faults are themselves large scale examples of shear zones. Here we study experimentally a recent theoretical prediction that shear zones behave in striking analogy with geometric optics, and compare our results with numerical simulations. We show that shear zones alter their orientations when crossing media boundaries similarly to light refraction but here the frictional properties of the materials take the role of the optical refractive index. We find that the refraction phenomenon also exists in the presence of gravity, i.e. under natural pressure conditions. In certain configurations we observe another effect, namely that shear zones can be deflected by the material interface.