One of the first casualties of any epidemic is tourism.

The outbreak of Ebola in west Africa provides the latest evidence. "The Ebola scare is really affecting bookings," says Darren Julyse, a manager with a boutique hotel group in Lagos, Nigeria's largest city and its commercial capital. "A lot of big companies are putting on travel restrictions." Nigeria has registered just two deaths from Ebola.

Business has suffered more in Guinea, Liberia and Sierra Leone, where the virus has killed more than 1,000 people in all. Government restrictions on the movement of goods and people have halted commerce in some areas. Cross-border markets have been shut down, stripping vendors of their one source of income. Farmers have fled affected zones, leaving crops to rot in the fields.

Governments and aid groups will probably spend hundreds of millions of dollars containing Ebola and caring for its victims. But the cost to the affected economies could well exceed the medical bills. The extent of the damage will depend on how far the disease spreads and how long the outbreak lasts. Already the World Bank has revised down its economic-growth estimate for Guinea this year by one percentage point. The Liberian finance minister believes that the IMF's projection of 5.9 percent growth in his country is now unrealistic.

The economic costs of epidemics are often out of proportion to their death toll. The outbreak of severe acute respiratory syndrome (SARS) in 2003 is estimated to have caused over $50 billion worth of damage to the global economy, despite infecting only about 8,000 people and causing fewer than 800 deaths. That is because panic and confusion can be as disruptive as the disease itself. Studies of past outbreaks have shown that lethal diseases that lack a cure tend to provoke overreactions. This is true even if the risk of transmission is low, as is the case with Ebola.

Governments walk a fine line between limiting the spread of a disease and causing needless disruption. Panic is avoided not just by combating an epidemic, but by being seen to do so. Transparency is important. By disclosing the extent of an outbreak, governments limit the spread of rumors and encourage an appropriate response from business and the public.

But there is also the risk that weak governments will simply expose their impotence.

In the Ebola-afflicted parts of west Africa where health systems have been overwhelmed, some foreign companies are already pulling out workers. A number of big mining firms have evacuated foreign staff and shut down nonessential operations.

China Union, which began shipping iron ore out of Liberia this year, is scaling down its activities and has threatened to shut up shop temporarily if the outbreak is not contained. IHS, a risk consultancy, thinks that if the virus spreads further more mining operations will be suspended, with potential declarations of force majeure. Investors have taken note: Share prices for heavily exposed companies have plunged since the epidemic began.

Even in Nigeria a handful of firms have removed foreign workers. Others are sneaking out employees under the guise of business trips or summer holidays. But most firms are taking a wait-and-see approach. Shell, an oil company with big investments in the country, has appointed a crisis-management team that grades the risk level according to the death toll and the geographic spread of the disease.

If travel restrictions tighten and escape routes close up, the pressure on firms to pull out of west Africa will grow. British Airways, Emirates and two African airlines have already halted flights to some affected countries.

Analysts reckon that others will follow. IHS believes that Western governments may ask businesses from their countries to leave if the outbreak spreads to more cities. In Lagos, where many firms base their regional operations, investors have so far remained calm. But their contingency plans are being kept close to hand.

Copyright 2013 The Economist Newspaper Limited, London. All Rights Reserved. Reprinted with permission.