If you throw a ball through a pile of sand, it will slow down in the sand and emerge at less that its initial speed. But when light shines on a pane of glass, even though it slows down inside, its speed upon emerging is the same as its initial speed. Explain.