RAED KHADER, a Jordanian driver, has an alarming habit of thumbing his mobile phone while at the wheel—albeit on a straight road cutting across the desert. But after scrolling back through almost two years of photos, he finds a picture that tickles him: of camels against a sandy backdrop. Today that same spot outside Ma’an, a poverty-stricken city in south Jordan, is crawling with workers in the final stages of installing five square kilometres (almost two square miles) of solar panels.

He is enraptured by the photovoltaic (PV) modules that shimmer in the desert sunshine. “It’s amazing. I love it. It’s good to see my country develop its own source of energy,” he says. “We have such good sun here. It’s free. Why don’t we use more of it?” In his enthusiasm, he has convinced his daughter to become one of the first Jordanian women to study for a solar-energy engineering degree.

The 160-megawatt (MW) solar park, which is scheduled to open this summer, will mark the launch of Jordan’s effort to reduce its fossil-fuel imports, which generated 96% of its energy last year and cost about 10% of GDP. In a restive neighbourhood, it has good reason to become more self-reliant. Its liking for solar intensified after Egypt temporarily cut natural-gas supplies during the Arab spring in 2011.

The small steps sanctioned by Jordan’s cautious bureaucracy pale in comparison with the growth of solar energy in some other countries. But they illustrate the allure of the technology, as well as some of its teething problems.

Across the developing world, solar power is hitting its stride. Rather than the rooftop panels popular in Germany, countries where solar irradiance is much stronger than northern Europe are creating vast parks with tens of thousands of flexible PV panels supplying power to their national grids. Some countries, such as China, provide generous subsidies (though these are sometimes years overdue). But in other countries solar PV is becoming competitive even without financial support.

In 2015 China surged past Germany to become the biggest producer of solar energy, benefiting from its dominance of solar-panel manufacturing and policies to reduce dependence on dirtier fuels, such as coal. Solar power accounts for just 3% of the electricity mix, but China is now building its biggest plant, in the Gobi desert. Analysts expect the country to install 12 gigawatts (GW) of solar in the first half of this year. That would be one-third more than the record amount America plans to build for the full year. Coal, meanwhile, is in growing trouble (see article).

India is determined to keep up. Its government is targeting a 20-fold increase in solar-power capacity by 2022, to 100GW. Though this might be over-ambitious, KPMG, a consultancy, expects solar’s share of India’s energy mix to rise to 12.5% by 2025, from less than 1% today. It thinks solar in India will be cheaper than coal by 2020. (Even Coal India, a mostly state-owned entity, plans to contract 1GW of solar power to cut energy bills.) Such is the frenzy that officials in sunny Punjab are urging farmers to lease their land to solar developers rather than till it.

Led by big projects in these two countries, global solar-energy capacity rose by 26% last year. More remarkable is the decline in its cost. Studies of the “levelised cost” of electricity, which estimate the net present value of the costs of a generating system divided by the expected output over its lifetime, show solar getting close to gas and coal as an attractively cheap source of power. Auctions of long-term contracts to purchase solar power in developing countries such as South Africa, the United Arab Emirates, Peru and Mexico provide real-world evidence that such assumptions may even prove to be conservative (see chart).

In sunny places solar power is now “shoulder to shoulder” with gas, coal and wind, says Cédric Philibert of the International Energy Agency, a prominent forecaster. He notes that since November 2014, when Dubai awarded a project to build 200MW of solar power at less than $60 a megawatt hour (MWh), auctions have become increasingly competitive. Some renewable-energy developers are gaining global reputations as record-breakers. The Dubai bid was won by Acwa Power, a Saudi company that is taking big strides across the Middle East and Africa, despite the oil-rich kingdom’s own half-hearted plans for solar development. In Morocco it has built the first phase of the world’s largest solar-thermal plant, which is using mirrors to generate heat to drive electricity turbines. Moody’s, a rating agency, says the completed plant will cut Morocco’s oil-import bills by 0.3% of GDP.

Let the sunshine in

Italy’s Enel Green Power (EGP) is also attracting attention. In February it won a tender to provide Peru with 20 years of power from solar PV at just under $48 a MWh. Just over a month later Mexico awarded it a similarly lengthy contract to generate solar power in the arid northern state of Coahuila at a price of about $40 per MWh. Bloomberg New Energy Finance (BNEF), a research firm, called it “the lowest subsidy-free solar contract we have ever seen”. EGP’s head of business development, Antonio Cammisecra, says there is a clear trend of falling prices. “We are trying to drive it,” he says.

The main factor behind the price drop is an 80% fall in the cost of solar panels since 2010, according to the International Renewable Energy Agency, an industry body. But Mr Cammisecra says that may now be close to ending. He travelled to China this week to persuade panel manufacturers to invest more in technological improvements, in order to increase the amount of solar energy that can be converted into electricity.

Analysts are also concerned that some providers’ auction bids may be over-aggressive, though companies can incur stiff penalties if they fail to complete a contract. Mr Philibert notes that some contracts may collapse because bidders are unable to raise finance.

Jenny Chase of BNEF says that in some cases “the model is being pushed to the absolute limit”. Indian firms, for example, are calculating development costs well below comparable global benchmarks. “I struggle to see how they will do this without cutting corners,” she says.

Jordan is a case in point. A Greek developer, Sunrise, last year agreed to charge $61 per MWh to build a 50MW solar plant north of Amman, which rival developers thought too cheap because of relatively high financing costs in Jordan. Last month Acwa Power bought the Jordanian unit in order to rescue the contract. Analysts say it is hard to see how Acwa will make money from it, but the gesture may help it win solar contracts in the future.

The kingdom offers more lessons on potential pitfalls. Like many developing countries, its national electricity company, NEPCO, has failed to expand its grid as quickly as private firms can erect solar parks, though it now has funding to build high-voltage transmission lines to connect the solar plants to Amman, the capital, where most electricity is consumed. (This problem is shared with China, which sometimes forces solar and wind plants to “curtail” their electricity output because the grid lacks the capacity to absorb it.)

But Jordan is blessed with geographical features that will let it expand its solar capacity once it has ironed out its problems. Engineers say that the area around Ma’an, with about 330 sunny days a year, has some of the best solar irradiance in the region. They add that, because of its altitude and terrain, heat and dust do not substantially lower the efficiency of the PV panels, as they do in neighbouring Saudi Arabia.

Support also comes from the top. King Abdullah has ordered solar panels to be installed on palaces and mosques, businessmen say. His most senior ministers drive Tesla electric vehicles. With more solar energy, the economic future of Jordan would be brighter and the country less at risk in a volatile region. All it needs is for the sun to energise its bureaucrats.