Imagine two futures.

The year is 2050. The world is more polluted, unequal, and dangerous than ever. Megacities like New Delhi, Mexico City, and Lagos are suffocated by smog. More than a billion people around the world still lack access to reliable electricity. And climate change is serving up droughts, floods, and heat waves with alarming regularity.

The trouble is that fossil fuels continue to exert a stranglehold on the global economy. Coal and natural gas are still burned to produce most of the world’s electricity and run most of its factories, spewing carbon dioxide and other climate-warming gases into the atmosphere. And oil still fuels a majority of cars and trucks, as well as almost every single airplane and ship on the planet, further polluting the air.

Much of this disastrous state of the world is a result of the solar power revolution sputtering out. Way back in 2016, solar photovoltaic (PV) panels, which convert sunlight into electricity, became the cheapest source of electricity on the planet. Experts breathlessly prophesied that it was only a matter of time before solar PV dethroned fossil fuels—a bold claim for a technology that supplied less than 1% of the world’s energy needs then.

But sometime in the 2030s, solar power’s once-unstoppable growth slowed, leaving it far short of dethroning fossil fuels.

For a time, those rosy projections were vindicated. Over the next two decades, solar PV would soar in popularity. In developed countries, new homes came with sleek solar roofs, and in the poorest corners of the developing world, stand-alone solar systems gave millions of villagers with no connection to an electricity grid their first taste of modern energy. And as producers—mostly in Asia—churned out silicon-based panels year after year, they got better at shaving the technology’s costs.

But sometime in the 2030s, solar power’s once-unstoppable growth slowed, leaving it far short of dethroning fossil fuels. On its face, this stagnation was puzzling: if solar PV kept getting cheaper, widening its competitive lead over fossil fuels, why did its expansion slow?

Solar’s gloomy days

Part of the problem was that even as the cost of producing electricity from solar PV fell, the value of that electricity—the amount that a utility, for instance, was willing to pay for it to then send via the grid to meet the needs of homes and businesses—decreased even faster. The value diminished because a power source tied to unreliable sunshine quickly becomes a nuisance as it grows. PV panels produce power only when they receive sunlight, so even a passing cloud can sideline them. In California, for example, solar PV quickly rose to meet most of the state’s power needs around lunchtime, when the sun was overhead. But then, adding a new solar panel, no matter how cheap, was worthless because when the state needed power—at dinnertime—the sun was setting. As a result, the gently declining cost of existing silicon solar PV technology was soon overtaken by the swift erosion of the value of the power the panels could produce.

Some countries—especially those that raced ahead to deploy solar PV projects—recognized that solar’s value was in decline. But they were confident that lithium-ion batteries, which were also getting cheaper alongside PV panels, would come to the rescue. The falling cost of these batteries did indeed make it feasible to store some of the unused daytime solar power for later in the evening. Batteries, though, were not the panacea that many expected. It made economic sense to use them to store power for a few hours; but they were too expensive to use for smoothing out the day-to-day variations in solar PV output and certainly for handling the biggest energy storage need: squirreling away surplus solar energy from sunny months for use in gloomier ones.

Solar PV’s growth also slowed because countries, especially in the developing world, failed to build out their electricity grids to keep up with the deployment of solar power. For example, India struggled to connect solar farms in distant deserts to its thirsty megacities. And when the government shifted focus to deploying solar panels on building rooftops, ramshackle urban grids buckled under the strain of absorbing sudden surges of solar power.

As a result, the world still depends on fossil fuels to meet most of its electricity needs.

With the exception of wind power, other clean energy sources have not stepped in to pick up much of the slack. And even though wind power rose alongside solar PV for a time, it too was unreliable and so faced limits on its deployment. Having slowed their growth to a crawl, the two sister sources of renewable energy today produce a disappointing one third of the world’s electricity.

More reliable sources of clean energy have disappointed. Nuclear power—politically radioactive—has declined from its glory days in the twentieth century to just a few remaining reactors in Asia today. Building new hydropower dams remains just as unpopular. And various other potential clean energy sources—from geothermal to tidal power—remain mostly on the drawing board. As a result, the world still depends on fossil fuels to meet most of its electricity needs.

On top of this, many of the world’s energy needs don’t involve using electricity. Those needs are met almost exclusively by fossil fuels, and they have only grown as emerging economies have industrialized, with staggering consequences. Industrial facilities, like cement and steel plants, belch out soot from burning coal. Although it once looked like autonomous vehicles and ride-sharing apps might take cars off the road and use the remaining ones more efficiently, the opposite has happened, as these advances have made it easier and cheaper than ever to get around by car. Though electrics have risen to lead the pack in new vehicle sales, over 1 billion petroleum-fueled cars and trucks still share the road.

A warmer world

It seems laughable that way back in 2015, countries around the world signed the Paris climate agreement, committing in all seriousness to limit global warming to 2°C. Just fifteen years later, those countries had already pumped enough greenhouse gases into the atmosphere to guarantee at least such a temperature rise.

Like a runaway train, the changing climate can’t be stopped.

Climate change has already taken a toll around the world. Rising sea levels have spurred waves of mass migration from the floodplains of Bangladesh. Ocean acidification has decimated fisheries from Norway to Nicaragua. Droughts across Africa and the Middle East have left hundreds of millions in a persistent state of famine and water scarcity; Egypt has just declared war on Ethiopia for choking off its supply from the parched Nile river. The US suffers an increasing number of superstorms on the Atlantic seaboard and perpetual wildfires in the west. Like a runaway train, the changing climate can’t be stopped. Not now, nor for the next 10,000 years.

Belated international efforts to drastically curb global emissions have stalled. Emergency negotiations at the United Nations over a global carbon tax don’t stand a chance of finding common ground among bickering blocs. While the political theater has played out, entire countries—including the Marshall Islands, Tuvalu, and Fiji—have been swallowed whole by the Pacific Ocean.

The time for decisive action is long past. With the benefit of hindsight, it is increasingly clear that the meteoric growth in solar power lulled governments into false confidence before their rude awakening to the solar slowdown. They left the transition to clean energy on autopilot. Had they instead made a small course correction in those early days—by planning for, and investing in, the future—today’s gloomy outlook might have been avoided.

***

The alternative

The year is 2050. Despite facing grave challenges, the world still controls its destiny. Nightmare scenarios of economic and humanitarian catastrophe—toward which the planet once hurtled—are off the table. The climate is undeniably changing, but at a manageable pace that has allowed countries to adapt.

The dramatic rise of clean energy has prevented climate change from spiraling out of control—and in the process powered economic growth and lifted the world’s destitute out of darkness. For the first time in history, fossil fuels are on the wane. A dwindling number of plants still burn coal and natural gas to produce electricity and run factories, but their carbon emissions get captured and either used in industrial processes or stored deep underground. Oil still fuels a large percentage of global transportation, but that share falls every year as electricity and clean fuels are used instead.

Solar energy is the linchpin of this clean energy revolution.

Solar energy is the linchpin of this clean energy revolution. Today, it supplies a third of global electricity; well before the century is out, most of the world’s energy needs will be met by converting sunlight into electricity, heat, and portable fuels. When that happens, the 21st century will be remembered as the one in which humankind finally tamed the sun.

China-produced PV panels played an important role in establishing solar technology as a feasible source of energy. Their early success also reassured the world’s biggest investors that it was safe to invest in clean energy projects. But those original PV panels—heavy, ugly, and maxed out in terms of performance—evolved to become lightweight, attractive, and much more efficient at converting sunlight into electricity. By 2030, industrial printers were churning out rolls of solar PV coatings in a range of colors and transparencies. A decade later, solar-coating your house was as cheap as painting it. Today at the mid-century mark, most urban buildings are wrapped in electricity-generating solar materials that tint the windows, enliven the facade, and shrink the carbon footprint.

Still, these wondrous solar PV cannot supply power once the sun sets. Fortunately, that need has been met by a completely different solar technology that enjoyed a renaissance in the 2020s after analysts prematurely wrote it off as dead. Concentrated solar power plants, which employ armies of mirrors to focus the sun’s rays to generate heat that can run a power plant, are able to store the heat that they capture to produce power throughout the night.

In recent decades, the term “solar energy” has supplanted “solar power.” That’s because PV and other solar technologies not only generate electric power now, they also produce fuels that can store energy to be used where electricity is less practical. In the mid-2030s, firms began to mass-produce materials to convert sunlight directly into hydrogen fuel. Slowly but steadily, the makeup of the world’s fuel mix has shifted toward zero-carbon solar fuels. Just as oil refineries convert crude oil into products like gasoline, jet fuel, and asphalt, so do solar refineries convert hydrogen into liquid fuels for vehicles, ships, and aircraft and into a whole range of other products, from fertilizer to plastics. Hydrogen itself has become a popular fuel for cars and trucks. Petroleum-fueled vehicles are now a distant third-place choice, behind electric and hydrogen-fueled vehicles, neither of which contributes to local air pollution.

Today’s panoply of solar technologies is the result of farsighted decisions made over three decades ago in the public and private sectors to invest in innovation. The US led this push and has profited handsomely as a result, now that the combined market for solar technologies is bigger than that for petroleum products. Just as America had surged past Saudi Arabia in 2013 to become the world’s biggest oil producer, so too did it dethrone China 20 years later as the leading manufacturer of solar technologies. The US managed to achieve prosperity and energy security at the cost of a few billion dollars a year in additional funding for research into and development and demonstration of new technologies.

Although solar energy has emerged as the star of the energy revolution, every star needs a supporting cast.

Countries have cooperated to build out continent-spanning power grids—the biggest ones are in Asia and North America—that connect solar PV in sun-drenched deserts with power-hungry cities. Not only are grids bigger, but they are smarter. They transmit signals to billions of Internet-connected devices—such as air conditioners, water heaters, and industrial machinery—that adjust their electricity demand on the fly to match the availability of solar PV supply. In addition, they can call upon various options to store intermittently produced solar energy, from batteries to hydropower reservoirs to underground wells. Grids can even intelligently decide when to charge up or draw down the millions of plugged-in electric vehicles that act as mobile batteries to back up solar PV.

Although solar energy has emerged as the star of the energy revolution, every star needs a supporting cast. Wind power has ably supplemented solar, rising steadily during this century. And the renaissance of nuclear power has shored up the supply of reliable electricity after governments around the world braved political headwinds to invest in a new generation of safer, cheaper reactors. Seeing the writing on the wall, fossil fuel companies have done their part as well, lavishly funding the development of technologies to capture and store the carbon emissions from the fossil-fueled plants that remain. And they have invested heavily in their own portfolios of renewable energy projects.

To ease water scarcity, countries have turned to cheap solar PV to run desalination plants that transform saltwater into freshwater. Concentrated solar power plants have also been repurposed in the developing world to power refrigeration, preserving badly needed food supplies and blunting famine.

The sobering scientific consensus predicts that the climate will continue to change for the foreseeable future. To stabilize it, governments are in final negotiations before unveiling a massive effort to suck carbon dioxide out of the atmosphere. Some of the countries hardest hit by climate change are clamoring for alternative approaches, like seeding the world’s clouds to reflect more sunlight. Fortunately, governments can afford to deliberate carefully over whether and how to engineer the climate. Sharply reducing global carbon emissions from energy has bought them time to do so.

Few would dispute that solar energy has emerged as one of the most important technologies—if not the most important one—of the twenty-first century. It may not have ensured victory over global challenges like climate change. But it has given the world a fighting chance.

***

The sky’s the limit

The world may well be bound for the first of the two futures laid out here—and that’s terrifying. But there is cause for optimism: the second future is not science fiction, but rather still an achievable goal. To arrive at it, the world must address the many challenges of realizing solar energy’s sky-high potential—and that will require sharply increasing investment in innovation.

Varun Sivaram is the Philip D. Reed fellow for science and technology at the Council on Foreign Relations and author of Taming the Sun: Innovations to Harness Solar Energy and Power the Planet, from which this essay has been adapted. This article is part of Quartz Ideas, our home for bold arguments and big thinkers.