The moon is in a nearly circular orbit around the earth, so the changing distance between them is not the key to the tides. The key is that the moon is at different distances from different parts of the earth. Newton figured out that the gravitational pull from one object on another goes inversely with the square of the distance between them, at least for distances big compared with the sizes of the objects. That means that the parts of the ocean near the moon are getting pulled extra-hard toward the moon. The parts on the opposite side of the earth are getting pulled relatively weakly, compared to the average for the whole earth. So you'd expect two bulges in the oceans- one on the side toward the moon, because it's pulled up a lot. The other is on the side away from the moon, which is not pulled down enough to keep up with the earth. Of course in real life, the actual bulges are complicated by the odd shapes of the oceans, friction, weaker tides due to the same sort of effect from the sun, etc. Nevertheless Newton's key idea, explaining why there are two high tides per day, is correct.
It's not hard to work out the heights of the tides assuming that the earth is solid and that water can flow freely. The solid earth assumption is needed for the pull of the moon averaged over the whole earth to make some sense -- the earth has to be pulled away from the water on the far side, and this is assuming it's rigid. But the earth is made up of mostly molten components, and only the top crust is solid. The ground also swells up and down with the tides, but less so than the oceans, because it is in fact a bit more rigid. If the earth were as fluid as the water, you standing on the seashore wouldn't notice any tide at all because the seashore would move up and down in precisely the same way as the water.
(published on 10/22/2007)