As Ronald Reagan stood coatless in the autumn chill of the City Hall Plaza speaking to the citizens of this overwhelmingly Democratic state, Edward W. King, the former Democratic governor of Massachusetts, sat on the platform behind him.

King and his kind brought Reagan to Boston for the second time in his life. Many here who call themselves Democrats -- on the rolls they outnumber Republicans by 4 to 1 -- are planning to vote, not just for Reagan but for the right-wing Republican candidate for the Senate, Ray Shamie. His chances of beating Lt. Gov. John F. Kerry are reckoned so good that White House politicians finally booked the president into the Kennedy stronghold in his final, 10-state, take-it-all pre-election drive.

The president did not seem completely at home in the only state that voted for George McGovern in 1972. He dutifully hailed Boston as the "hub of the universe," but addressed it rather as the sports capital of the world, saluting Boston College's champion football team and its candidate for the Heisman Trophy and reminding the audience that he had received the Boston Celtics in the Rose Garden. That sort of jock talk goes down extremely well in places like South Boston, where disenchantment with programmatic liberal Democrats runs high.

The reception for Reagan, who described himself as a "hardheaded Irishman," was not entirely worshipful. Scattered in the crowd of 25,000 to 30,000 were disrespectful signs -- "KKK for Reagan" was one and hecklers who shouted, "Dump Reagan" and booed his rather defiant invocation of the still sacred name of John F. Kennedy.

No one knows better the power of right-wing Democrats in the Massachusetts electorate than the governor, Michael Dukakis. In 1978, as the incumbent, Dukakis was 30 points ahead in the polls -- and was upset by King in the primary. Four years later, having forsworn his chilly ways and moderated his liberal views, Dukakis was forgiven and taken back.

"Massachusetts is not monolithically Democratic," said Dukakis, in his beautiful blue high-ceilinged office with a Paul Revere bronze chandelier over his head. "This state is no different from the rest of the country -- it is independent and looking very carefully at the candidates."

Looking at Shamie, voters are eventually seeing a candidate who answers their anger at busing and abortion, and whose "only in America" personal success story is regarded as inspirational.

Claire Marino, an over-30 waitress from Everett who came to cheer Reagan in the plaza, considers herself a Democrat. She hasn't voted for a Democrat for president since 1972, but she won't reregister as a Republican, as Reagan would like her to do. She likes "some Democrats" and would like to see Teddy Kennedy become president -- "If he got in, he wouldn't be as liberal as he is now."

A black-haired, 22-year-old student at Suffolk Law School named Jerry Waggett has not really decided yet, but to him, "Mondale is a typical Democrat, for abortion and all." Reagan "had a nerve," as a Democrat for Nixon in 1960, to use John F. Kennedy's farewell to the Massachusetts legislature in his speech, Waggett thought, but it didn't offend him enough to vote against the president -- "That's what politicians do."

It is this kind of ambivalence that makes Shamie a fairly good bet against Kerry, an articulate, decorated Vietnam veteran. Even Shamie's documented dalliance with the John Birch Society did not sink in. He is like Reagan, an amiable, non-threatening figure. The Birch connection didn't faze Reagan who long ago in California had to contend with it himself. It wasn't ideological delicacy that kept him away: he was merely waiting for his managers to make sure that Shamie was within striking distance of Kerry.

Dukakis calls Shamie "an extremely conservative fellow who, for obvious reasons, had to moderate his conservatism."

"He said the other day," Dukakis noted, "that he's for all the social programs, for UDAG (Urban Development Action Grants) and he's against acid rain. Of course, he's all for defense spending, too, and against tax increases."

The governor points out that when Shamie, a self-made industrialist, made his debut in politics as a kamikaze candidate against Edward Kennedy two years ago, he beat Kennedy in South Boston.

And that is why Reagan, dreaming of pulling in a Republican Congress in the anticipated landslide, held up Ray Shamie's hand in Boston.

It would be lovely for him to win Massachusetts, which he took in 1980 with only 6,000 votes. It would be the frosting on the cake if he could make Massachusetts send Shamie to the Senate.