Judy Lawson of Annapolis, who was rescued by a steamer after 31 days at sea in the Observer Singlehanded Transatlantic Race, returned home yesterday with a tale of gales, whales, a leaky yacht and rig troubles that began when her mast first buckled 10 days into the 3,000-mile race.

Lawson was one of three women among the 89 competitors in the race from Plymouth, England, to Newport, R.I., that began in June. Naomi James of England was the only woman to complete the course.

Looking fit, Lawson held a press conference at Scandinavian Yacht Sales to describe what happened to her Danish-built, BB 10-class 32-sloop, named Serta Perfectsleeper.

"The first part of the race was uneventful," she related, "but on Day 11, I heard a loud crack. When I looked up, the mast was bent like a piece of spaghetti."

Lawson said she dropped the mainsail and headed for the Azores under jib alone in a strong wind and fairly heavy seas. "But when the sea went down, I was able to replace the starboard lower stay, and turn back on course."

For the next week, Lawson said she had a "dream cruise," reaching in moderate air alone a rhumbline course. She narrowly missed striking a sleeping whale, which "suddenly woke up and waved to me with its flukes."

Nearing Newfoundland, however, Lawson's boat was hit by a gale with winds of 50 knots, and began to leak. Water was entering the bull through a small drainage hole in a forward anchor locker, and also in lockers built into the boat to reduce the volume of her cocpit.

"We knew the lockers weren't right, because on the sail over, we almost foundered when they filled up," she said. "Towards the end of the race, I was pumping and bailing every hour." The fourth and final gale struck July 6, when she was near Sable Island, the first and most dangerous landfall onher route. Lawson dropped her main and sailed slowly that day and the next.On the morning of July 8, she had shaken out all but one reef and was proceeding comfortably in a 10-20 knot northwesterly.

"I went below and suddenly heard a sickening, wrenching, crunching sound. When I looked, the whole rig had gone over the side, broken right at the base." She cut away the wreckage and watched it sink in the crystalclear water, she said.

With her jury rig inadequate, the prospect of more gales imminent and the boat continuing to take on water, she switched on her emergency position indicating radio beacon. Within four hours after that, a 680-foot ship, carrying coke from Norfolk to Romania,was alongside. Lawson was hauled on board, and so was Serta Perfectsleeper. They both got off at Gibraltar. o

According to Lawson, the probable cause of her dismasting was metal fatique. She praised the BB-10 as a sturdy boat, and said the leaks were entirely the result of racing modifications that were "not done quite right."

Lawson's sailing background includes much dinghy racing, where she was known as an aggressive and determined competitor, and lately in solo and short-handed offshore events. She intends to continue such sport.

"I'm entered in the 1982 round-the-world singlehanded race," she said yesterday. "For that, I'll need a bigger boat."