The second presidential debate was remarkable for the dourness of its mood and for the subdued demeanors of the candidates even as they tore into each other.

Neither presidential candidate was selling “morning in America.” At times it seemed more like a competition to see who could paint the gloaming in the least unsettling hues.

Tuesday night’s presidential debate was remarkable for the dourness of its mood, for the frequently subdued demeanors of the candidates even as they tore into each other, which they did with somewhat less vigor and venom than expected, given how little time remains until Election Day, given how nasty the campaign had turned in recent days.

The debate — the second of three, and the only one to be conducted in a town-hall style — came on a day the stock market closed nearly 1,700 points lower than it had on the day of their first debate. Even then, Sen. Barack Obama already was talking of the country’s worst economic crisis since the Great Depression.

The situation now looks gloomier still, with markets in other continents tumbling — with a world of hurt at hand. And the sort of can-do, feel-good, rah-rah exuberance that candidates sometimes bring to forums like Tuesday night’s was in conspicuously short supply.

“I’m going to ask the American people to understand that there are some programs we’re going to have to eliminate,” Sen. John McCain said at one point, and he said it not as a defiant assertion of waste but as a rueful acceptance of reality.

Obama, referring to rising oil prices and limited oil supplies, said moments later, “There is going to be the need for each and every one of us to start thinking about how we use energy.”

There were echoes — almost — of Jimmy Carter in that sentence. When was the last time a candidate vying for the highest office in the land summoned a memory of him rather than Ronald Reagan?

To be sure, there were also the usual, classic, timeless assertions of American resourcefulness and optimism, along with the inevitable Reagan reference — by McCain.

Obama noted that President Kennedy promised the moon — and the country indeed got there.

McCain said: “We can attack energy and health care at the same time. We’re not rifle shots here. We’re Americans!”

It was the oratorical equivalent of Gov. Sarah Palin’s flag pin during the last debate, easily twice as big and twinkly as Sen. Joseph Biden’s.

And there were a few moments during the long first hour — and a few more during the quick last half-hour — when the exchanges grew more spirited and tense. McCain’s apparent irritation with his opponent spiked as he exhibited condescension toward his younger rival.

“By the way, my friends, I know you grow a little weary of this back-and-forth,” McCain said, as he seized one of many occasions to characterize Obama as a relentless spender.

“There was an energy bill on the floor of the Senate loaded down with goodies, billions for the oil companies,” McCain continued. “And it was sponsored by Bush and Cheney. You know who voted for it — you might never know? That one.” He pointed toward Obama without, tellingly, looking at him.

“You know who voted against it?” he asked. “Me.”

In the last half-hour, McCain — who has been falling ever further behind Obama in national polls and many swing-state polls — grew even more combative, his jaw clenching ever tighter, his words squeezed out.

And when the debate had ended, McCain hustled away, while Obama lingered, chatting with the audience and signing autographs.

But during the first hour of the debate, candidates’ voices communicated anger less often than mere frustration. The decibel level was sometimes whispery and the gestures usually muted. There were no exaggerated huffs, no big laughs, no long sighs.

And many of the attacks, counterattacks and lightning rods of recent days never made it onto the red-carpeted stage.

Palin? Absent. So was any mention of Bill Ayers, the former radical Weathermen group leader whom the McCain campaign has tried to link closely to Obama.

And the “Keating 5″ scandal, the subject of a recent Obama campaign Internet video, took the night off as well.

It was as if the candidates had decided that the nation’s anxiety was too profound for Americans to be subjected to anything too ugly, anything that might make them even more uneasy.

Or, rather, that such a spectacle would not serve the candidate deemed to be the principal agent of it. They were not striving for passionate. Somber and steady seemed to be the goals.

That is not to say they did not play on voters’ fears, each candidate casting the other as someone too risky for a juncture with issues so urgent and stakes so high.

McCain again suggested that Obama simply would not be able to find his way through this dangerous world.

“Thank you very much,” interjected McCain, the one who worked harder Tuesday night at such folksy notes — such as calling questioners and even Tom Brokaw by their first names; roaming so far and wide across the stage it seemed he would end up in the Nashville suburbs; and saying “my friends” so often it sounded less cordial than compulsive.

Obama then continued: “Senator McCain, this is the guy who sang, ‘Bomb, bomb, bomb Iran,’ who called for the annihilation of North Korea.”

Despite some odd syntax and stutters during that exchange, Obama spoke more fluidly than McCain, and so calmly that the town-hall format was a largely wasted opportunity. Obama didn’t use it to communicate any of the spontaneity he has been accused of lacking.

McCain, for his part, used the paper in front of him to write so many notes to himself, in such a focused fashion, that he could have passed for a student in a penmanship class.

But his message was that he was the teacher, the veteran, the one who knew the score and could show the way. He insisted as well that he alone had a record of bipartisanship — that Obama was too liberal to reach across party lines.

Although McCain never mentioned Palin, he mentioned Sen. Joe Lieberman at least four times. It was a way of summoning an independent — formerly a Democrat — to his side and saying “maverick” without actually saying it.

But for almost every Lieberman allusion, Obama made two to Bush. And he was not allying himself with the president. He was hanging him around McCain’s neck.