On a rainy day last December, Washington political consultant David Doak sat down in the Commonwealth Quality Inn here to talk with a potential client, Virginia state Attorney General Gerald L. Baliles.

"We never signed any papers," Doak said, "just sealed it with a handshake." For Baliles, then widely regarded as a distant underdog in his race for the Democratic nomination for governor, the meeting was crucial.

Doak helped craft an aggressive strategy that Baliles used to win the nomination. His advice: portray Baliles as a moderate, close to Democratic Gov. Charles S. Robb, a rightful heir to the governorship who could best challenge the GOP for the large number of Virginia voters who consider themselves moderates.

That same month, Edward S. DeBolt, an Arlington political consultant and holder of an impressive string of campaign victories in Virginia, was counseling Wyatt B. Durrette -- a longtime friend and former Northern Virginia neighbor -- on strategies that ultimately won Durrette the Republican nomination for governor.

DeBolt's idea was simple and direct: Play to the traditional strengths of Virginia Republicans; stress support of conservative principles; use the backing of highly popular President Reagan in Virginia; picture Durrette as a warm and worthy disciple while portraying the Democrats as misguided liberals.

Tomorrow Virginia voters will pick between Baliles and Durrette for governor. But to many politicians in Virginia -- and the nation -- the outcome will be viewed as much as a race between two of Washington's top political consultants as between Republican and Democrat.

Besides the fee his firm will collect -- some say up to $200,000 -- each consultant is battling for something more: the right to claim he masterminded one of the two state elections this year as well as recognition that he did the best job of molding a candidate for the 1980s from two men who presented considerable problems:

For Doak, the challenge was to take the extremely serious and low-key Baliles and thrust him on the public stage as a likable successor to Robb, who had developed considerable popularity and charisma as the state's first Democratic governor in 12 years.

For DeBolt, the challenge was to take Durrette, an extremely personable Republican, well liked among party regulars, and build him into a credible candidate despite his defeats in two previous statewide campaigns and an absence of eight years from public office.

The Baliles ads sought initially to soften his harsh image, portraying shots of him as an avid fisherman and outdoorsman, paddling a canoe and walking in the woods with his son. Others emphasized his link to Robb, arm in arm at the party's June convention, tackling state problems, attempting to dispel any doubts about Baliles as a fiscal conservative.

To cut away at charges he was weak on crime, the campaign filmed an ad in Arlington showing Baliles speeding off in a sheriff's car in pursuit of criminals, a takeoff on the opening scenes of the popular "Hill Street Blues" television show.

In a key strategy decision, Doak and Baliles' other advisers agreed, despite a wide lead in most polls, to maintain a series of negative ads on Durrette throughout the campaign. The plan was to use TV to keep Durrette on the defensive.

Baliles' advisers said the tactic also was prompted by something rare for Virginia Democrats, an ability to outspend Durrette on television and to get a jump of more than three weeks of air time before Durrette's commercials started in mid-September -- the time when voters in Virginia were just beginning to develop images of the two candidates.

Doak began with 10-second spots that peppered Durrette as unreliable and a man who changed positions -- captured with the visual image of aroller coaster doing a loop. Later ads questioned the Republican's experience and highlighted tax bills Durrette introduced as a legislator.

"They're the ones who are spending hundreds of thousands of dollars on negative advertising . . . not us," said DeBolt, soft-spoken leader of his company, The DCM Group.

"We're spending the overwhelming majority of our money reminding Republicans what a fine man Wyatt is and what a great governor he will be," said the 47-year-old Republican adviser.

DeBolt's first major job in politics came in the mid-1960s when he was executive director of the California GOP under then-governor Ronald Reagan.

Reagan has been a centerpiece of the Durrette advertising, with television spots of Reagan's Oct. 9 appearance at an Arlington fund raiser that pumped $500,000 into Durrette's media budget.

Other ads have shown Durrette earnestly talking with schoolchildren, and nearly all the ads emphasize his varied experience as a politician, lawyer, community leader and businessman -- a determined effort to contrast Durrette with Baliles, who has spent most of his career as a lawyer for the state government.

This is the third gubernatorial campaign in Virginia for DeBolt, who came to Washington 15 years ago as deputy chairman of the Republican National Committee. He later formed a consulting business and guided the Virginia GOP gubernatorial victories of Mills E. Godwin in 1973 and John N. Dalton in 1977.

"I think he's the best there is in either party," said Dalton. If Dalton runs again -- and he has hinted he might in 1989 -- DeBolt would be "the first call I'd make," he said.

In late 1983 and this year, DeBolt helped Durrette defeat a determined and well-financed challenge by Rep. Stan Parris of Fairfax for the GOP nomination.

The fall election campaign, however, has not been easy for DeBolt. Dalton and other party leaders have decried the bitter infighting over strategy within the Durrette campaign that they say has undermined DeBolt's overall strategy and has made Durrette's campaign, at times, appear unfocused.

"Some of those people in Richmond are trying to destroy me," an unusually candid DeBolt said last month. DeBolt was referring to conservatives who had pressed Durrette to attack aggressively Baliles and his alliance with state Sen. L. Douglas Wilder of Richmond, the Democratic candidate for lieutenant governor.

Durrette sided with DeBolt's more positive approach, one that would stress Durrette's strengths, but not before the campaign was hampered by weeks of negative publicity, many Republicans say. At its peak, one Durrette adviser went outside the campaign and, without DeBolt's approval, contracted for a sharply negative ad depicting Baliles as "Pinocchio." Durrette vetoed the ad.

Durrette, campaigning in far Southwest Virginia yesterday, insisted he and DeBolt have had "no substantial differences" and that he takes DeBolt's advice "a high percentage of the time." The split, the nominee said, "was primarily a creation of the press."

"Some people might be second-guessing him, but I think he has the pulse of the Virginia electorate better than anybody I've ever seen," Dalton said of DeBolt.

DeBolt's company, which works out of modest offices that overlook the Arlington Courthouse, has run winning campaigns for Virginians John W. Warner, Harry F. Byrd Jr. and Rep. Frank W. Wolf as well as Dalton and Godwin. His other clients have included Republican Sens. Robert Dole of Kansas, James McClure of Idaho and William Roth of Delaware.

This year's campaign is the second major race in Virginia for Doak, 38, who guided Robb to his 1981 victory, which broke 12 years of Republican victories and was a race that did not involve DeBolt.

The Baliles campaign has been one of the first ventures of a company that he formed last year with two other Democratic campaign veterans, pollster Pat Caddell and Robert Shrum, a former press secretary and speechwriter for Sen. Edward M. Kennedy. The company, a block from the White House, has already signed up 1986 Democratic candidates for governor in Florida, Pennsylvania, Tennessee and Colorado, as well as the reelection effort of Sen. Alan Cranston (D-Calif.)