Boston — Massachusetts is the stage for what could become the costliest congressional campaign in the nation in 1982. Sen. Edward M. Kennedy (D) of Massachusetts and his Republican challenger, Raymond Shamie, are opening major fund-raising drives, much of them targeted on out-of-state contributors. If both candidates meet their goals, total combined campaign spending could pass the record $7.6 million spent in the 1976 North Carolina Senate race.
Mr. Shamie launched his campaign in October with full-page ads in 40 Massachusetts newspapers as well as in the Washington Post and Wall Street Journal. Thus far, Shamie claims to have raised between $400,000 and $500,000.
''And we are just getting going,'' says the GOP conservative, explaining that he needs $4 million to get his message to the voters. But so far the prospects for toppling Senator -Kennedy appear slim.
In each of his past three senatorial campaigns, Kennedy's strategy has been to ignore his opposition and pursue his own course based on the issues he wants to discuss. This seems unlikely to change in 1982. Still, the veteran Democrat is not taking his reelection for granted. He has been a longtime target for political extinction by the National Conservative Political Action Committee. Kennedy's campaign spending is expected to top $2 million.
Shamie, however, is convinced that his will be a candidacy that cannot help but evoke Kennedy response.
So far, no groups of the so-called New Right have climbed aboard the Shamie bandwagon. Nor has their help been solicited. But those close to Shamie anticipate such backing, and he makes clear he welcomes financial support from that ''or any other legitimate source, providing there are no strings attached.''
In a four-color fund-raising brochure, he promises ''a serious challenge: one that will keep Teddy Kennedy campaigning at home instead of helping liberal candidates around the country'' and ''will put him out of the 1984 presidential race.''
Shamie, the founder and president of Metal Bellows Corporation, a high-tech firm, supports President Reagan's fiscal programs and condemns the liberal Democratic incumbent as ''a big spender, out of step with what the people want.''
Massachusetts Republican leaders, especially moderates and liberals, had hoped that a GOP contender of greater prominence would step forward to challenge Kennedy. But now, party officials may have little choice but to throw their weight behind Shamie. With the state GOP preprimary convention less than three months away, only one other possible Republican senatorial contender has surfaced; she is Dr. Mildred Jefferson, an antiabortion activist.
Six years ago it was almost the last minute before the GOP could come up with a challenger to Kennedy. The nominee, curtain manufacturer Michael Robertson, wound up with less than 34 percent of the votes cast.
Since winning his Senate seat in 1962 in an election to fill the final two years in the term of his brother, President John F. Kennedy, Massachusetts' senior senator has thrice handily beaten Republican ballot foes. His closest campaign was in 1970 when he bested Josiah A. Spaulding 58.85 percent to 41.15 percent.
More than $1 million was spent in the 1976 Massachusetts senatorial campaign - $896,000 by Kennedy and $168,000 by his GOP opponent.
The most expensive senatorial campaign in history was in 1978 in North Carolina where Republican incumbent Jesse Helms raised $7.4 million and his Democratic challenger John Ingram $264,000.