There are moments  increasingly rare in risk-abhorrent modern campaigns  when politicians are called upon to bare their fundamental beliefs. In the best of these moments, the speaker does not just salve the current political wound, but also illuminates larger, troubling issues that the nation is wrestling with.

Inaugural addresses by Abraham Lincoln and Franklin D. Roosevelt come to mind, as does John F. Kennedy’s 1960 speech on religion, with its enduring vision of the separation between church and state. Senator Barack Obama, who has not faced such tests of character this year, faced one on Tuesday. It is hard to imagine how he could have handled it better.

Mr. Obama had to address race and religion, the two most toxic subjects in politics. He was as powerful and frank as Mitt Romney was weak and calculating earlier this year in his attempt to persuade the religious right that his Mormonism is Christian enough for them.

It was not a moment to which Mr. Obama came easily. He hesitated uncomfortably long in dealing with the controversial remarks of his spiritual mentor and former pastor, the Rev. Jeremiah A. Wright Jr., who denounced the United States as endemically racist, murderous and corrupt.