If it continues to escalate, which it will, and eventually into war, it won't be a traditional war, countries against countries like previous world wars, it will be each country engaging in guerilla warfare within their own borders, rooting out the terrorists from within.
Unfortunately the media would like us to think war is the only option, but it certainly is not. In fact I think war will just make the problem worse. I will explain why.
I think this terrorism has nothing to do with religious belief. Sure it does for the foot soldiers, who have been conned, but not for the masterminds. I think the masterminds don't have a religious bone in their bodies. They are simply using extremist versions of Islam as a recruiting tool, to recruit their foot soldiers to do the killing, because it's the best recruitment tool they currently have.
The masterminds are driven by hate, specifically against the West, for either real or perceived injustices of the past and present, against their countries and their peoples. They are not driven by religious ideals. And this terrorism is their retribution.
I think the western leaders know this (I'm talking about both political and business leaders), but it is in their interests to maintain the facade of this being a religious war, because it helps keep the truth obscured, it helps keep their crimes hidden, it helps to deflect the disgust of the general population onto the terrorists, and away from them.
So I think ultimately, the only solution is reconciliation, which requires honesty from leaders on both sides, education of the population about the true past, and forgiveness from everybody on both sides. Something which in the current world political climate is pretty much not going to happen.
And just in case someone reading this thinks I'm on the side of the terrorists, because they haven't understood what I've written, I want to make it very clear that I am not. Violence is never the answer in a civilized world, and the violent acts and crimes of these terrorists is appalling and revolting, and will never solve anything. But you have to stop thinking this whole mess is created by a bunch of nutcase young men who believe in silly religious ideas, and start to understand that ultimately this mess is the result of grievances felt by peoples who have been exploited by the west for generations. And therefor ultimately the only way this mess is going to get fixed is for the west to start down the path of reconciliation.