We present experiments on slow shear flow in a split-bottom linear shear cell, filled with layered granular materials. Shearing through two different materials separated by a flat material boundary is shown to give narrow shear zones, which refract at the material boundary in accordance with Snells law in optics. The shear zone is the one that minimizes the dissipation rate upon shearing, i.e.a manifestation of the principle of least dissipation. We have prepared the materials as to form a granular lens. Shearing through the lens is shown to give a very broad shear zone, which corresponds to fulfilling Snells law for a continuous range of paths through the cell.