Mr. McCain’s aides said Tuesday that the senator was shutting down his Michigan state office. Given his financial difficulties, the aides said that Mr. McCain was almost certain to accept public money for his campaign, despite the sharp restrictions it would place on his spending in the primary and in the months leading up to the general election, as a way to be able to afford television advertising early this year. They said that would guarantee an infusion of about $6 million, based on what he has raised so far, and perhaps a total of $15 million by the time the caucuses start here in January.

Mr. McCain’s advisers said they were hoping he would, over the next six months, be able to raise $25 million, matching what he raised in the first half of the year. They acknowledged, though, that that would be difficult because donors would be reluctant to write checks to a campaign that appears to be in crisis.

“I wouldn’t be straight with you if I didn’t say there would be a significant initial drop-off from this,” said John Weaver, a senior adviser to Mr. McCain. “But our finance people are confident that if we show the kind of movement that we think we can, that we’ll get back on track.”

Some of the Democratic advantage appears to stem from the success the party’s candidates have had in tapping into grass-roots enthusiasm for dislodging the Republicans from the White House. Mr. Obama’s campaign has reported receiving donations from more than 258,000 contributors this year and raising $10 million online in the second quarter. More than 80,000 donors contributed to the Romney campaign in the second quarter, 50,000 of them for the first time; in the first quarter, 32,000 people contributed to his campaign.

For years, Republicans prided themselves on having a large base of individual donors while Democrats relied to a large degree on unregulated soft money donations that have now been banned. So far in this cycle, Democrats appear to be building vast databases of new individual donors who could be called on by the party for years to come.

Mr. McCain reported Tuesday that he had just $2 million in the bank to cover the operations of his campaign; Mr. Giuliani’s campaign said he had nine times as much, or $18 million, and no debt. Mr. Romney has about $12 million in cash on hand for use in the primary.

Mr. McCain’s aides declined to say what outstanding debt he would report. Mr. Romney’s decision to again invest his own money into the campaign — he lent it $2.35 million in the first quarter — was clearly intended to signal he was prepared to use his wealth to offset the bad fund-raising environment his party finds itself in. Mr. Romney has been plowing through his money rapidly, pouring much of it into an expensive early advertising campaign focused on Iowa and New Hampshire that has helped him to leads in recent polls there.