From the Ballston Metro stop to the Arlington Courthouse, from a Fairfax senior citizens home to the BDM Corp. in McLean, everywhere Republican senatorial candidate Paul S. Trible Jr. went in Northern Virginia, his message was the same: "I am the Northern Virginia candidate."

A few days later, Richard J. Davis, his Democratic opponent, was greeting commuters at the Pentagon stop, handing out blue and white fliers that bore a similar slogan: "Dick Davis listens to Northern Virginia."

It was all part of the wooing of the Washington suburbs, whose bustling sprawl may hold the key to the tightest Senate race in the nation. Traditionally viewed as alien by many downstate politicians, Northern Virginia, with its burgeoning population and the highest percentage of undecided voters in the state, has become almost indispensable to recent state-wide candidates. Yet its transient population, seesawing allegiances and expensive advertising rates can also make it a political nightmare.

Political strategists for both campaigns say Northern Virginia is particularly critical to Davis, who swept it by an impressive 55-45 percent margin in his successful race for the lieutenant governorship last year. With polls showing Trible leading decisively in his Newport News district and the Richmond area, they say, Davis must make up his losses here.

"We need to do as well or better than in the lieutenant governor's race in Northern Virginia if we are to be successful," says James Carville, Davis' campaign manager.

Trible would be satisfied to cut his losses here and preserve his strength elsewhere in the state. "If our opponent wins the 8th and 10th Northern Virginia congressional districts , Congressman Trible can still win the Senate race in Virginia," says Trible press spokesman Neil Cotiaux.

Trible and Davis both have visited the area often. But in the last five days of the campaign, Davis plans three Northern Virginia visits, two of them appearances with Gov. Charles S. Robb, who calls Northern Virginia home. Trible has no plans to visit again.

Trible's Northern Virginia appeals have focused on his home in Fairfax County, where he stays when Congress is in session, and his votes for legislation sponsored by area congressmen. "Paul has lived here in Northern Virginia," Rep. Frank R. Wolf told a group of senior citizens during a campaign swing with Trible this week. "He knows what it's like to drive down Shirley Highway in rush hour at night. He knows what it's like to try and get a cab at National Airport on a Sunday night."

Davis, a former mayor and lifelong resident of Portsmouth, has stressed his backing for continued Metro funding, Social Security and the Equal Rights Amendment. He also has won the support of influential local developers such as Giuseppe Cecchi and Myron P. Erkiletian, who were important conservative supporters of Robb's campaign. "These types of opinion leaders are listened to and are respected for being successful," says Steve Stone, Davis' Northern Virginia coordinator. "Their support has translated into financial support and votes."

Both candidates have aimed special messages to the powerful federal employe block, visiting the National Association of Retired Federal Employees to tell them they oppose a merger of the federal retirement system with Social Security. While Davis' message was well-received by the group, Trible got a hostile reaction from association members who denounced him for backing a Reagan budget bill that cut cost-of-living adjustments for retired federal workers from twice to once a year.

But perhaps the most significant weapon on the Northern Virginia battle ground is airtime. Davis' campaign will spend 40 percent of its $700,000 radio and television budget in the Washington market, where $6,000 bought a half-minute of TV time during the World Series. The same time segment cost $900 in Norfolk.

And then there are phone banks, door-to-door canvassing, leafleting, and any of a number of political tasks performed by an army of volunteers that can change the vote by a few percentage points on election day. The Trible campaign reports that five GOP phone banks are operating in Northern Virginia, staffed by workers who call Republican-leaning voters to urge them to cast their votes for Trible. Undecided voters get follow-up mailings and phone calls. The Democrats have three phone banks in the area.