"Buy a new rope"... It depends on how bad the rope is (salty, dirty, etc). In most cases they can be saved through some combination of cleaning, flipping end for end or cutting and re-splicing.
Another way to clean it is to cut it from the chain, take it home, put it in a mesh bag and put it in your washing machine - front loader's work better than one with an agitator - just in case the rope comes out of the bag. Could always go to a laundromat, too. Then soak it in a pail of water and fabric softener for a day. If you don't know how to splice, or don't want to take a chance on it for the first time, there's usually someone at the marina that knows how to do it. New England Ropes has a good online tutorial.