Spartite is a 2 part product that you pour into the space between the mast and deck. It dries to a hard ruber like thing. Seems to be pretty effective at keeping water out.
I think it comes in 2 sizes... If you have a really old boat, you probably need the larger size.