The competing strategies in this close contest are clear. They are trading ethical charges, which is probably a wash with voters. Mr. Cuccinelli is counting on his passionate base among social conservatives. The Virginia electorate that will turn out in November will be older, more white and more evangelical than the voters who helped President Barack Obama carry the once reliable Republican stronghold by four points last year. If the voter profile had replicated that of the last governor’s race, in 2009, Mr. Obama would have lost.

“There are a lot more committed voters who will turn out for Ken than there are committed voters who’ll turn out for Terry,” said Chris LaCivita, a leading Cuccinelli adviser.

The Republicans are trying to tie Mr. Obama’s record around the Democratic candidate’s neck, especially the Affordable Care Act. “Obamacare is the biggest impediment to job growth in the state,” Mr. Cuccinelli said in an impromptu interview last week. He was the first to bring a lawsuit against the health care measure (without success).

The attorney general, comfortable his base will turn out, is focusing on jobs and the economy and de-emphasizing his social positions. He has declared that abortion is as bad as slavery and that same-sex relationships violate the laws of nature and could be prosecuted. He is really moving away from E.W. Jackson, the minister chosen by the conservative-dominated Republican state convention to be the party’s lieutenant governor nominee. Mr. Jackson has accused Mr. Obama of being a Muslim and an atheist — a tough trick — and suggested that yoga could lead to Satanism and that Planned Parenthood had been more harmful to blacks than the Ku Klux Klan.

The Democrats are quick to remind voters of Mr. Cuccinelli’s social views. At the same time, Mr. McAuliffe is warming to the debate over jobs and the economy. He is more comfortable than his opponent in talking to business types; he’s been shaking them down for campaign funds for decades. He has won the endorsements of leading Republican business figures and prominent former office holders.