The star of the show was missing from the skies above the Farnborough air show, Europe's biggest aerospace get-together, which began on July 14. The F-35 fighter, which was to have made its first appearance outside America, was grounded after an engine fire.

Not taking to the air when expected is a trait of Lockheed Martin's jet. It is years behind schedule and stratospherically over budget. Its absence is an embarrassment for Lockheed but, then again, its presence might have reminded the defense officials shopping at Farnborough of just the sort of complex and expensive program they want to avoid signing up to in future.

Arms makers are going through a lean period. Some big contracts, such as ones to make bombers, trainer aircraft and drones, are still up for grabs in America, the world's biggest spender. But it and other rich-world governments, struggling to curb their deficits, are trying ever harder to get the most bang for the fewest bucks. The revenues of 17 of the top 20 American weapons makers shrank in 2013. American-led wars in Iraq and Afghanistan had helped to push global spending to a record $1.7 trillion in 2008. Since then it has plunged by $100 billion, according to IHS Jane's, a consulting firm.

The good news for arms makers is that the worst is probably over. America's Congress has partly reversed automatic cuts it had imposed to deal with a ballooning deficit. In Europe the rate of decline is slowing. Growing wealth in emerging economies and new threats in Syria, Iraq and the South China Sea are encouraging rapid spending growth in Asia, the Middle East and Latin America.

Although the Pentagon's budget is as big as that of the next 15 defense ministries combined, its coffers are no longer bottomless. It wants more "make do and mend," upgrading existing equipment. The model here is Boeing's venerable B-52 bomber, which has been constantly refitted, and is on track to fly past its 90th birthday in 2042.

The Pentagon has moved away from "cost-plus" contracts, which give contractors an incentive to overspend, since they are guaranteed a margin on top of whatever their costs turn out to be. But in the department's annual assessment of its own competence as a buyer, published last month, it noted that fixed-price contracts have not always proved better: Indeed, contractors sometimes end up with profit margins "spectacularly" higher than in cost-plus deals. So the Pentagon is seeking to create more sophisticated contracts that encourage arms makers to find cost savings that are shared with the taxpayer.

America is taking an interest in moves across the Atlantic, especially in Britain, to get companies to take over the ownership and upkeep of weapons systems. A deal Britain struck with BAE Systems in 2009 provides "strike power by the hour" for the Royal Air Force's Typhoon fighter jets. The RAF's commitment to low-cost flying was reinforced with the announcement at Farnborough that maintenance contracts for transport planes would go to Flybe, a budget airline.

An earlier squeeze in military spending, in the 1990s, prompted a spate of mergers, as weapons makers cut costs by joining forces. This time the Pentagon has made it clear that it will not accept further consolidation that damages competition. With mergers out of the question, the big military contractors had to move quickly to prepare for the most recent round of spending cuts, by slashing costs and laying off battalions of workers. Now they are looking at what else they can do.

One answer is to find civilian markets for their products. Some big suppliers to the armed forces, such as Boeing and UTC — the owner of Pratt & Whitney, a maker of jet engines — already have even bigger civilian sides. Secure communications systems, for example, could help to protect banks and other businesses from hackers. Raytheon has just sold its Boomerang sniper-detection system to American power firms, after a gunman knocked out several transformers providing electricity to Silicon Valley.

As yet, though, such contracts are a small part of most arms businesses: civilian cybersecurity and related activities provide only 2 percent of Lockheed's revenues, for example. And although weapons makers are "essentially tech firms," as Rami Myerson of Investec, a bank, puts it, they may struggle to compete with nimbler Silicon Valley outfits. Indeed, these are beginning to invade the defense industry's territory.

As warfare goes digital, tech firms have shown that they can supply robots, drones and intelligence software. SpaceX, founded by Elon Musk, a tech entrepreneur, is taking America's Air Force to court in an attempt to reopen bidding for a satellite-launch contract awarded to Boeing and Lockheed.

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