Snell's law for viscoelastic materials