Climate activists these days seem to be on a roll. On September 21, hundreds of thousands of protesters poured onto the streets of New York for the People’s Climate March, a massive demonstration in support of action to curb carbon emissions. The next day, the Rockefeller Brothers Fund—the family philanthropy whose scion, John D. Rockefeller, founded Standard Oil—joined a small but growing group of institutional investors who have announced they’ll begin divesting from their fossil-fuel holdings because of climate concerns.

The day after that, a parade of strange bedfellows took the stage at a United Nations “climate summit” to pronounce their commitment to fighting global warming. Among them, surprisingly, were oil-and-gas company chief executives, who delivered a not-so-subtle message: It’s the coal producers, not us, who are most culpable for climate change, so please, dear regulators and environmental campaigners, go after them, not us.

“Replacing coal with gas in power generation is a simple way of halving emissions,” Helge Lund, CEO of Norway’s state-controlled oil giant, Statoil, said. He was correct that burning coal to produce a given amount of electricity emits about twice as much carbon dioxide as does burning natural gas. What he didn’t say was that Statoil, like most oil companies, produces a lot of gas along with its petroleum, so it will gain big new markets if the world continues to shift electricity production to gas from coal.

This fossil-fuel infighting shows the energy industry is shifting in ways that are creating new winners and losers. The shift is only starting, though, and it’s playing out more messily than many of its environmentalist boosters hoped. The climate lobby is gunning to get rid of fossil fuels. But that’s not happening. Oil and gas companies are betting, thus far correctly, that curbing climate change will pad their profits. And yet the coal industry, vilified by both the gas sector and the environmentalist flank, is still maintaining a strong global toehold.

In the days leading up to the New York climate summit, Ben van Beurden, chief executive of Dutch-based oil company Royal Dutch Shell, said that a crucial part of any move to curb carbon emissions is to “accelerate the shift to cleaner fossil fuels like natural gas.” He didn’t mention that his company also would benefit financially if natural gas, one of its core products, grabbed more market share from higher-carbon coal. But the notion that fossil fuels could be replaced by renewable energy, van Beurden added in an interview with The Washington Post, is “a fantasy.”

The coal industry hasn’t missed these provocations. Last Friday, Peabody Energy, one of the nation’s biggest coal producers, issued an angry statement arguing that coal actually can be a clean energy source and denouncing the fossil-fuel-divestment campaign as naive. Gregory Boyce, the company’s chief executive, argued that climate change pales beside another global social and environmental concern, one coal companies happen to help: the lack of access to electricity, particularly in the developing world, where huge numbers of people cook their food with wood, a fuel that’s arguably dirtier than coal-fired power.

"Reasonable people can disagree on the urgency of addressing concerns about carbon, but no one can question the crisis we face when more than 4 million people die annually from indoor air pollution resulting from energy poverty," Boyce said in the statement. He added that “calls to divest from fossil fuels from a tiny fraction of global investors are misguided and anti-poor. All investors should be calling for more advanced coal use to alleviate energy poverty and drive major environmental gains.”

The players here are lashing out at each other because they’re feeling increasingly threatened—not just by the specter of government regulation, a force they’ve gotten good at taming, but also by investor and public opinion, a force they find less predictable and, increasingly, a good deal more alarming. Yet it would be a big mistake to interpret this offensive by the gas industry and climate activists as a death knell for coal.

Even in the United States, where the rise of gas has been most pronounced, coal still generates more power than gas does; between 2004 and 2013, as the portion of U.S. electricity produced from gas jumped from 18 percent to 27 percent, the portion from coal fell from 50 percent to 39 percent, according to federal figures. In contrast, though, on a global scale, coal use is still rising—meaning coal still has a long life ahead of it.

Moreover, in the United States, where gas has wrested significant market share from coal, the main driver has been economics, not environmental rules: Fracking has slashed the cost of producing gas, making gas cheaper than coal. In theory, tough new government carbon limits of the sort advocated by gas producers and environmentalists could raise the cost of burning coal to the point that they effectively barred coal use in the United States. In practice, though, carbon limits that stringent have essentially no chance of passage in Washington. That’s why tougher pollution caps that the Obama administration recently imposed on coal-fired power plants serve largely to codify a shift to gas that low gas prices already had started—not to prompt a big new dash to gas. If gas prices rose again, coal use could, too.

Finally, the anti-coal pressure from the gas lobby and from climate advocates isn’t likely to do much at all about the rising use of coal where it matters most, in the developing world. There, coal use is rising because demand for cheap energy is soaring and because natural gas can’t currently satisfy that demand. In China and many other developing countries, unlike in the United States, a robust natural-gas-drilling infrastructure remains, quite literally, a pipe dream.

The question before the coal and gas industries is whether this calculus will hold. It’s conceivable that the fossil-fuel-divestment push could snowball into a movement that does more than flood the streets of Manhattan on a sunny September afternoon. It’s possible that it could persuade policymakers that public sentiment indeed is behind radically tougher climate rules. The odds right now are against that. But things could change, and, if they do, coal may well not be the only victim. A public backlash against fossil fuels could end up slapping the gas industry, too. Which explains why the gas industry right now is trying so hard to harness the anti-carbon push rather than let it spin out of control.