How to fake refraction - what is the math?

I think the math you are looking for is called Snell’s Law. Ryan Brucks actually made a blog post about an optimized version of it.

For any surface with a texture to it though (such as water) my advice would be to just multiply a noise or normal map texture by a scalar (to control the refraction intensity) and add it to your UV coordinates. Works really well when paired with some parallax.