“The statesman can only wait and listen until he hears the footsteps of God resounding through events; then he must jump up and grasp the hem of His coat, that is all.” Thus Otto von Bismarck, the great Prussian statesman who united Germany and thereby reshaped Europe’s balance of power nearly a century and a half ago.

Last week, for the second time in his presidency, Barack Obama heard those footsteps, jumped up to grasp a historic opportunity … and missed it completely.

In Bismarck’s case it was not so much God’s coattails he caught as the revolutionary wave of mid-19th-century German nationalism. And he did more than catch it; he managed to surf it in a direction of his own choosing. The wave Obama just missed—again—is the revolutionary wave of Middle Eastern democracy. It has surged through the region twice since he was elected: once in Iran in the summer of 2009, the second time right across North Africa, from Tunisia all the way down the Red Sea to Yemen. But the swell has been biggest in Egypt, the Middle East’s most populous country.

In each case, the president faced stark alternatives. He could try to catch the wave, Bismarck style, by lending his support to the youthful revolutionaries and trying to ride it in a direction advantageous to American interests. Or he could do nothing and let the forces of reaction prevail. In the case of Iran, he did nothing, and the thugs of the Islamic Republic ruthlessly crushed the demonstrations. This time around, in Egypt, it was worse. He did both—some days exhorting Egyptian President Hosni Mubarak to leave, other days drawing back and recommending an “orderly transition.”

The result has been a foreign-policy debacle. The president has alienated everybody: not only Mubarak’s cronies in the military, but also the youthful crowds in the streets of Cairo. Whoever ultimately wins, Obama loses. And the alienation doesn’t end there. America’s two closest friends in the region—Israel and Saudi Arabia—are both disgusted. The Saudis, who dread all manifestations of revolution, are appalled at Washington’s failure to resolutely prop up Mubarak. The Israelis, meanwhile, are dismayed by the administration’s apparent cluelessness.

Last week, while other commentators ran around Cairo’s Tahrir Square, hyperventilating about what they saw as an Arab 1989, I flew to Tel Aviv for the annual Herzliya security conference. The consensus among the assembled experts on the Middle East? A colossal failure of American foreign policy.

This failure was not the result of bad luck. It was the predictable consequence of the Obama administration’s lack of any kind of coherent grand strategy, a deficit about which more than a few veterans of U.S. foreign policy making have long worried. The president himself is not wholly to blame. Although cosmopolitan by both birth and upbringing, Obama was an unusually parochial politician prior to his election, judging by his scant public pronouncements on foreign-policy issues.

Yet no president can be expected to be omniscient. That is what advisers are for. The real responsibility for the current strategic vacuum lies not with Obama himself, but with the National Security Council, and in particular with the man who ran it until last October: retired Gen. James L. Jones. I suspected at the time of his appointment that General Jones was a poor choice. A big, bluff Marine, he once astonished me by recommending that Turkish troops might lend the United States support in Iraq. He seemed mildly surprised when I suggested the Iraqis might resent such a reminder of centuries of Ottoman Turkish rule.

The best national-security advisers have combined deep knowledge of international relations with an ability to play the Machiavellian Beltway game, which means competing for the president’s ear against the other would-be players in the policymaking process: not only the defense secretary but also the secretary of state and the head of the Central Intelligence Agency. No one has ever done this better than Henry Kissinger. But the crucial thing about Kissinger as national-security adviser was not the speed with which he learned the dark arts of interdepartmental turf warfare. It was the skill with which he, in partnership with Richard Nixon, forged a grand strategy for the United States at a time of alarming geopolitical instability.

The essence of that strategy was, first, to prioritize (for example, détente with the Soviets before human-rights issues within the U.S.S.R.) and then to exert pressure by deliberately linking key issues. In their hardest task—salvaging peace with honor in Indochina by preserving the independence of South Vietnam—Nixon and Kissinger ultimately could not succeed. But in the Middle East they were able to eject the Soviets from a position of influence and turn Egypt from a threat into a malleable ally. And their overtures to China exploited the divisions within the Communist bloc, helping to set Beijing on an epoch-making new course of economic openness.

The contrast between the foreign policy of the Nixon-Ford years and that of President Jimmy Carter is a stark reminder of how easily foreign policy can founder when there is a failure of strategic thinking. The Iranian Revolution of 1979, which took the Carter administration wholly by surprise, was a catastrophe far greater than the loss of South Vietnam.

Remind you of anything? “This is what happens when you get caught by surprise,” an anonymous American official told The New York Times last week. “We’ve had endless strategy sessions for the past two years on Mideast peace, on containing Iran. And how many of them factored in the possibility that Egypt moves from stability to turmoil? None.”

I can think of no more damning indictment of the administration’s strategic thinking than this: it never once considered a scenario in which Mubarak faced a popular revolt. Yet the very essence of rigorous strategic thinking is to devise such a scenario and to think through the best responses to them, preferably two or three moves ahead of actual or potential adversaries. It is only by doing these things—ranking priorities and gaming scenarios—that a coherent foreign policy can be made. The Israelis have been hard at work doing this. All the president and his NSC team seem to have done is to draft touchy-feely speeches like the one he delivered in Cairo early in his presidency.

These were his words back in June 2009:

America and Islam are not exclusive and need not be in competition. Instead, they overlap, and share common principles—principles of justice and progress; tolerance and the dignity of all human beings.

Those lines will come back to haunt Obama if, as cannot be ruled out, the ultimate beneficiary of his bungling in Egypt is the Muslim Brotherhood, which remains by far the best organized opposition force in the country—and wholly committed to the restoration of the caliphate and the strict application of Sharia. Would such an outcome advance “tolerance and the dignity of all human beings” in Egypt? Somehow, I don’t think so.

Grand strategy is all about the necessity of choice. Today, it means choosing between a daunting list of objectives: to resist the spread of radical Islam, to limit Iran’s ambition to become dominant in the Middle East, to contain the rise of China as an economic rival, to guard against a Russian “reconquista” of Eastern Europe—and so on. The defining characteristic of Obama’s foreign policy has been not just a failure to prioritize, but also a failure to recognize the need to do so. A succession of speeches saying, in essence, “I am not George W. Bush” is no substitute for a strategy.

Bismarck knew how to choose. He understood that riding the nationalist wave would enable Prussia to become the dominant force in Germany, but that thereafter the No. 1 objective must be to keep France and Russia from uniting against his new Reich. When asked for his opinion about colonizing Africa, Bismarck famously replied: “My map of Africa lies in Europe. Here lies Russia and here lies France, and we are in the middle. That is my map of Africa.”

Tragically, no one knows where Barack Obama’s map of the Middle East is. At best, it is in the heartland states of America, where the fate of his presidency will be decided next year, just as Jimmy Carter’s was back in 1980.