I've thought about this a lot lately. Even if McCain had a great campaign and Obama had a poorly-run campaign, it would still be difficult for McCain because 2008 is such a Democratic year in so many ways. The fact that he is so far down in the polls is largely because, in a bad year for the Republicans, the McCain campaign has been idiotic and the Obama campaign has been about as close to perfect as a presidential campaign can get.
First, he should never have chosen Sarah Palin as his running mate. She fired up the base and got good news coverage for a few days, but since then she has been an anchor dragging down the entire campaign. Those Charlie Gibson and Katie Couric interviews marked the moment of no-return, because the American people saw quite clearly that she has no business being next-in-line for the Presidency. Worse, choosing her made McCain look rash and impulsive, which are not qualities the American people want in their President.
Second, a better-run McCain would never have mentioned the Bill Ayers and ACORN bullshit. Any consultant that had stepped out of their office at least once this year could have told him that that kind of thing is not what voters want to hear this year. It just made the McCain campaign look bitter and devoid of any ideas, an impression that Obama campaign did as much as possible to encourage. It's telling that the Obama people didn't respond by attacking McCain on his own questionable associations- they see clearly that, far from hurting them, McCain's dumb attacks merely help Obama.
The "Joe the Plumber" thing helped a bit, but it was too-little-too-late. By the time the McCain campaign got on this message, the vast bulk of the American people had already made up their minds.
I think the decision to abandon Colorado and dump everything into Pensylvania (where Obama is ahead by more than ten points) was a mistake. The McCain campaign continued to waste time and resources on blue states where their chances of victory were slim to none, while allowing red states like Virginia and North Carolina to slip into Obama's orbit without a fight.
So, a better-run McCain campaign would have chosen a different VP (Kay Bailey Huchison would have been smart), not restorted to misleading personal attacks, and focused his campaign message on the "Joe the Plumber" theme for the moment the convention was over. That would have made McCain much more competitive, but even then the odds would have been against him.