Depends exactly on the setup you have. My SC20 has a hook on the mast and a welded ring and shackle. The secret is to get the sail blowing across the tramp away from the hook, raise the sail a little and then rotate the mast away from the sail.
BTW if you have this problem it is much easier to pull the boat over on its side on the beach than it is to step the mast with the sail attached. <img src="http://www.catsailor.com/forums/images/graemlins/smile.gif" alt="" />