John F. Kerry tried to set the terms for the closing debate by accusing President Bush on Monday of covering up ways he has helped rich friends and hurt consumers, while Bush scrambled to keep security at the forefront of the race by charging Kerry with treating terrorism negligently.

Twenty-two days before the election, the candidates were just 300 miles apart and their exchanges were among the most bitter and personal of the campaign as they jockeyed for momentum going into Wednesday's debate. Kerry, taking a break from debate preparation at a New Mexico resort, sought to crystallize his domestic policy agenda with a broad critique of Bush as a captive of the wealthy. He said Bush "has more excuses than results" on energy, jobs, health care and education.

Kerry vowed to make the United States "independent of Middle East oil in 10 years" through research and greater use of nuclear power, coal and natural gas. Wooing swing voters with a populist focus on pocketbook issues that have received little attention in the campaign, the Massachusetts senator blamed record gas prices on Bush's coziness with the oil industry and Saudi Arabia, as well as his "gross mismanagement and miscalculation regarding the war in Iraq," resulting in a risk premium on the price of oil.

"In the past four years, in nearly every decision he's made, George W. Bush has chosen the powerful and well-connected over middle-class Americans," Kerry said. He added that White House policies are "working for drug companies, they're working for HMOs, and they're certainly working for the big oil companies."

Although the final debate will be devoted to domestic and economic issues, Bush continued to try to focus attention on his strength -- his image as a stalwart commander in chief -- by declaring that Kerry "fundamentally misunderstands the war on terror."

Bush was seizing on a quotation that appeared in an 8,100-word cover story about Kerry's world view in Sunday's New York Times Magazine. Kerry, in arguing that the threat of terrorism need not perpetually alter the fabric of American life, said he wanted to "get back to the place we were, where terrorists are not the focus of our lives, but they're a nuisance." Kerry added, "As a former law-enforcement person, I know we're never going to end prostitution. We're never going to end illegal gambling. But we're going to reduce it, organized crime, to a level where it isn't on the rise."

Bush, speaking at a rally in Hobbs, N.M., said he "couldn't disagree more."

"Our goal is not to reduce terror to some acceptable level of nuisance," Bush said. "Our goal is to defeat terror by staying on the offensive, destroying terrorists, and spreading freedom and liberty around the world."

Vice President Cheney, traveling in New Jersey for the first time as the Bush campaign tries to make inroads in that Democratic stronghold, repeated a favorite Republican castigation of Kerry by calling his comments "naive and dangerous."

The Bush-Cheney campaign blasted Kerry's remark with an instant response ad for cable television that said: "Terrorism -- a nuisance? How can Kerry protect us when he doesn't understand the threat?"

Kerry's campaign issued a statement and produced an ad about the "nuisance" quote, but the candidate did not respond personally to Bush's accusations. "They're trying to get us off our message, and we're not going to let them," said Stephanie Cutter, the Kerry campaign's communications director.

Both candidates are working Western battlegrounds ahead of the debate at Arizona State University in Tempe. New Mexico, which Bush lost in 2000 by 366 votes, is one of the most closely contested states.

Kerry's speech was part of a new effort by his campaign to convince voters that sticking with Bush for four more years would be risky, contrary to the Bush-Cheney campaign's portrayal of the president as the safer choice at a time of global uncertainty.

Polls show the race remains close, but Kerry's aides believe they have found a winning line of attack -- that Bush stubbornly refuses to face reality about the bad choices he has made at home and abroad and is distorting the consequences. At each stop, the senator has begun saying Bush is in a "state of denial."

"Facts, as President Ronald Reagan reminded us, are stubborn things, Mr. President," Kerry said. Flinging back a new mantra Bush uses to criticize Kerry, the senator said, "To borrow a saying, when it comes to George Bush's record on gas prices, he can run but he can't hide."

Kerry accused Bush of doing nothing to upgrade the nation's electricity grid after last summer's blackout and said he would ease gas prices by making use of the Strategic Petroleum Reserve, which Bush has said he would do only in case of a severe supply disruption.

"I want an America that relies on its own ingenuity and innovation, not the Saudi royal family," he said, making his second recent effort to piggyback on charges made in the Michael Moore film, "Fahrenheit 9/11." Referring to White House efforts to prevent release of the records of Cheney's energy task force, Kerry said Bush "went all the way to the Supreme Court to protect the identity of his secret energy advisers."

The other speakers at the Cheney event were even more pointed about Kerry. After Cheney arrived in Medford, N.J., one of the warm-up speakers, David Jones, president of the State Troopers Fraternal Association of New Jersey, suggested to the crowd that terrorists support Kerry. If "Osama bin Laden and Saddam Hussein were able to go to the polls, who do you think they'd vote for?" Jones asked, saying those in the room were voting the other way. Bernard B. Kerik, a former New York police commissioner, also took on Kerry's "nuisance" line, saying "a nuisance didn't kill" the victims of Sept. 11, 2001. "Al Qaeda did," he added.

In Iowa, Democratic vice presidential candidate John Edwards announced a program to stem the use of methamphetamine drugs in rural areas. The North Carolina senator asserted that Bush had ignored the problem and pledged that a Kerry administration would "stop this deadly epidemic" by "cracking down on meth trafficking and expanding smart treatment and prevention."

Farhi is traveling with Bush. Staff writers Dana Milbank, traveling with Cheney, and Chris L. Jenkins, traveling with Edwards, contributed to this report.

Democratic presidential candidate John F. Kerry greets supporters after delivering a speech on energy at Santa Fe's Sweeney Convention Center.