The race to succeed Virginia Lt. Gov. Charles S. Robb -- a contest that is likely to provide a test of the political power of fundamentalist religious groups in the state -- began yesterday with announcements by a top Democrat and a Republican that they will seek office.

With Democrat Robb virtually assured his party's nomination for governor, former Democratic Party Chairman Richard J. Davis and Republican State Sen. Nathan H. Miller became the first major candidates to formally enter the contest for the state's second-highest elective office.

Virginia's statewide elections, less than a year off, are expected to test the power of religious groups, particularly that of the Lynchburg-based Moral Majority Inc., when Warrenton attorney Guy O. Farley Jr., a born-again Baptist, makes formal his widely anticipated entry into the race for the No. 2 spot on the GOP ticket.

Farley, a former Democratic state legislator from Fairfax, has indicated he will declare his candidacy for the post sometime next month. He has been actively courting the support of the Rev. Jerry Falwell, the television evangelist and head of the Moral Majority, and other religious conservatives, hoping to recruit their followers for his campaign.

Farley's standing among conservative Republicans, climbed noticeably last summer at the GOP national convention when he led platform fights to scrap the Equal Rights Amendment and adopt an anti-abortion Constitutional amendment.

Davis and miller, who announced their candidacies at separate new conferences yesterday, made pointed appeals for support from influential blocs. Davis, the 59-year-old lawyer and mortgage banker and former Portsmouth major, geared his remarks to the state's Republican-leaning business community. Miller, a 37-year-old legislator from the Shenandoah Valley who unsuccessfully sought the Republican Senate nomination in 1978, appeared to direct his remarks to the same religious conservatives Farley wants to keep in his campaign camp.

"Those principles of which I speak are as old or older than the state itself," said Miller, a boyish-looking lawyer who was elected to the State Senate in 1976 after serving in the House of Delegates for four years. "They are a belief in God, family, country, productive work and the right of the individual to make his own decisions, right or wrong."

When pressed by reporters, Miller said he would support the gubernatorial candidacy of Virginia Attorney General J. Marshall Coleman, who, despite some conservative opposition, is expected to have the GOP field to himself when he announces next month.

Davis, who resigned as Democratic chairman after the November elections, has forged a close relationship with Robb, and the two have worked to project a more conservative image for party. In announcing his candidacy, Davis said his business background would help him "assist in bringing to Virginia economic development opportunities which will enhance the economic base and provide jobs for our citizens."

Because of Davis' finance and industrial connections, he is seen by Republicans as a formidable election foe. Sounding like a Republican, he said yesterday that the private business sector should begin to participate with the state government in solving problems.

In addition to Davis, Miller and Farley, former Tazewell delegate Donald D. Dunford, a Democrat, has indicated he also will seek the lieutenant governor nomination. Last week former fairfax delegate Wyatt B. Durette annunced he would seek the Republican nomination for attorney general.

The leiutenant governor's office, which has few constitutional duties except to preside over the Senate, has been used traditionally as a stepping stone to a gubernatorial campaign. Some Democrats, citing the party's repeated losses in congressional and state elections during the last 14 years, have said that 1981 will be "do or die" year for them.