In a confrontation of ideologies that has come to resemble an alley fight, Sen. Jesse Helms (R-N.C.) and his Democratic rival, Gov. James B. Hunt Jr., have thus far battled each other to a draw in one of the longest, costliest and meanest political campaigns in the country's history.

Polls give Helms a slight edge, attributable in large part to President Reagan's popularity in the state. But Democratic strategists claim that Hunt's superior get-out-the-vote organization could well make up the difference, pointing to a standoff as the campaign heads into its final 10 days.

"What you've got right now is a million votes for Hunt, a million votes for Helms and about 200,000 voters who are being tossed around by the last television ad they've seen," said Hunt campaign director Joe Grimsley.

"Based on what I've seen . . . , I'd expect a wide margin," said Helms, "but reality tells me it will be very close."

In his campaign for a third term in the Senate and for survival as the New Right's foremost officeholder, Helms is once again on his way to breaking all records for spending in a Senate campaign. And only by comparison with Helms has Hunt come up short.

Together, they have already raised nearly $21 million: $13 million for Helms and almost $8 million for Hunt, which cumulatively comes out to about $10 per registered voter. It is enough to pay the salaries of all 100 senators for nearly three years or to finance the most expensive office operations of a single senator for at least 12 years.

By the Nov. 6 elections, they probably will have raised and spent nearly double the previous record, set by Sen. Pete Wilson (R) and former Gov. Edmund G. (Jerry) Brown Jr. (D) two years ago in California, the largest state, with four times North Carolina's population.

But the spending, spectacular as it has been for the country's 10th largest state, tells only part of the story.

The campaign, which has gone on at an extraordinarily high pitch for nearly two years, has polarized North Carolina as never before and touched raw nerves on sensitive points ranging from race relations to concern among the elderly about the Social Security system and fears of farmers about the future of tobacco.

Race has been a strong undercurrent in the Helms campaign, which put out a campaign newspaper picturing Hunt with Jesse L. Jackson and telling of mounting registration by blacks and a "Hunt-Jackson plan" to register more. Despite North Carolina's relatively moderate image on race relations, Helms is believed to have stirred a backlash among conservative white voters, prompting a surge in white registration in some areas.

Although the campaign has been waged largely on the television screen, in a cacophony of hard-hitting and largely negative ads, it has also become increasingly biting on the part of the two candidates as they have hit the campaign trail full time in the final stretch.

While Hunt accuses Helms of sacrificing North Carolina's interests in favor of promoting his own "global agenda" of right-wing causes, Helms has taken direct aim at Hunt's credibility and integrity.

At one point last week, for instance, as Hunt was accusing Helms of ignoring North Carolina in favor of his "right-wing friends" in other states and even abroad, Helms suggested that Hunt should confront "felony charges" for using state aircraft for political purposes, even though he subsequently repaid $186,000 for the trips.

Helms has also accused Hunt of running a "racist" campaign in the way he has courted black voters, and Helms' press secretary, Claude Allen, suggested recently that Hunt is vulnerable for his links "with the queers," as he put it.

The recriminations may not end by the time the polls open.

Helms is soliciting contributions for a "ballot-security operation" and is sending out return-to-sender postcards that are turning up in black precincts and appear aimed at identifying voters who recently changed addresses and thus could be challenged at the polls. In response, Democrats, fearing guerrilla warfare at the polls, are amassing a small army of lawyers for reserve duty on Election Day.

With both sides prone to litigation anyway, a post-election battle in the courts is considered possible if the outcome is exceedingly close.

Over their respective 12 years in state-wide office, Helms, 63, and Hunt, 47, have come to symbolize and articulate the two dominant, and often conflicting, forces of North Carolina politics, in which the progressivism and pragmatism of a "New South" threatens the pride and prejudices of the "Old South." They tap powerful emotional currents, creating a level of passion rarely seen in a Senate race.

Both popular and controversial in their own ways, they started out the campaign as household words to most North Carolinians, many of whom had satisfied their conflicting yearnings by supporting both men in their separate political careers.

But since their ambitions came together on a collision course, Hunt and Helms have virtually camped out in the living rooms of every owner of a television set and, like uninvited in-laws, have inflicted their strident, jarring arguments on everyone within earshot.

With their exorbitant spending and often outrageous sloganeering, they have taxed the patience of many North Carolinians, who complain long and loud about the campaign's excesses but also appear drawn to its inherent drama, even if against their better judgment.

A holy crusader to his friends, the prince of darkness to his foes, Helms looms larger than life in conservative and liberal communities as far away as California and New York, as does Hunt in the role of putative giant-slayer.

Despite its exploitive use of modern mass-media techniques, this is not a bland, blow-dried campaign of the modern genre. In some ways, it is a throwback to the days of simple, clear-cut choices, of absolutes unmarred by subtleties and of sheer, absorbing suspense.

So, their race has attracted attention and money from across the country, rivaled only by the presidential race. Half, and maybe as much as two-thirds, of their money has come from outside North Carolina, mainly through sophisticated mass-mailing operations targeted to sympathetic groups, a technique pioneered by Helms and emulated by Hunt. Even foreign television crews, from Western Europe to Japan, have been trailing Hunt and Helms along back-country North Carolina roads.

With the race as close as it is, the list of imponderables is long, ranging from the possibility of a return visit by Reagan on Helms' behalf to the effectiveness of the grass-roots organization that Hunt has built over the past decade in every one of the state's 2,355 precincts.

With Reagan running 15 to 20 percentage points ahead of Democratic presidential nominee Walter F. Mondale in North Carolina, even Democratic loyalists like state Democratic Chairman David Price concede that Hunt, who started out with a big, if soft, lead over Helms a year ago, has been dragged down by the presidential race.

As Mondale's fortunes faded, the Hunt campaign had to work ever harder just to stay even, according to one campaign aide. "It didn't help us any to have the top of the ticket running substantially behind. It meant we had to make doubly sure it didn't turn out to be a referendum on Reagan," said another.

Hunt makes little mention of his presidential ticket, although, when asked, he will state that he supports Mondale, even if he disagrees with him on specific issues such as tax increases.

By contrast, Helms, who has often been a thorn in the side of the Reagan administration in opposing some of its more centrist policies, has virtually wrapped himself in a Reagan cloak and made a major point of trying to tag Hunt with the label of "Mondale liberal."

On a recent foray through the conservative eastern North Carolina tobacco belt, for instance, Helms mentioned at nearly every stop that he was among a select few, including Senate Majority Leader Howard H. Baker Jr. (R-Tenn.) and Sen. Paul Laxalt (R-Nev.), the president's closest friend in Congress, who were invited to accompany Reagan to his first debate with Mondale in Louisville.

The Democrats wince at the thought of another presidential visit, even though they contend it would also be a sign that Helms could not win on his own.

As for organization, the Democrats have an edge over the Republicans, who are simply nonexistent as an organized political force in many counties of the state. But Republican registrations are up substantially in many of these areas, which political observers say is partly in response to an intensive and highly successful black voter-registration drive. Members of white fundamentalist churches are an effective pro-Helms organization in many areas.

One of the major unknowns is the degree to which blacks will be motivated to go to the polls. Democrats figure that the combination of Reagan and Helms will energize the black community but acknowledge that they are uncertain about the turnout.

Hunt campaign director Grimsley figures that the grass-roots Hunt organization is worth about 3 percentage points in the polls, meaning that Hunt could face Election Day with a 3 point gap in preference polls and still come out on top. "That's what Jim Hunt has been doing for 12 years, building a real grass-roots organization, and now's the big test," said campaign spokesman Will Marshall.

Although Helms has substantially outspent Hunt on television, the Hunt campaign contends that it will be "nearly competitive" through the last 10 days of the campaign, which will assure virtual saturation advertising by both men from now until Election Day.

As it winds down, the campaign has been so dominated by television advertising that the ads appear more central to the campaign than the candidates themselves, as the two men go through the campaign windup rituals.

Both are gregarious, folksy and skillful campaigners, but only Hunt appears to be working hard at it. On a foray through hospitable country in the low-lying, tobacco-growing eastern counties of the state last week, Helms spent most of his time preaching to the choir in visits among his staunch supporters at local campaign headquarters and at other small gatherings hosted by key backers. By contrast, Hunt worked his way through crowded shopping centers munching cashews (which he dutifully called peanuts) and even donned a shower cap at a paper-products company.

At a drugstore, where Hunt paused by the Halloween masks to chat with an old friend, two passers-by summed up where North Carolina stands on Hunt and Helms. "I'm with you all the way," shouted the first man. "Good God, that's Jim Hunt. Let's get the hell out of here," muttered the second.