BEIJING — Homes, businesses and even hospitals across northern China are running short of natural gas. Some schoolchildren are shivering. And in the chemical industry — well, the spandex supply is getting tight.

More than a decade ago, China began moving gradually to rely more on natural gas and less on coal, a dirtier form of energy. This autumn, faced with public pressure to clean smoggy skies, the government decided to pick up the pace.

In some places, that shift has gone awry.

The Chinese government on Tuesday shut down big chemical factories in western China for as long as four months to free up natural gas to heat homes and schools. And in Beijing, the city authorities have very publicly reversed a heavily promoted policy of ending municipal coal use. The city has turned a big coal-fired power plant in its southeastern suburbs back on — in the chilly air, it releases a towering, gray cloud of steam and pollution visible from tall buildings across much of the city.

“It is the most severe shortfall of natural gas since the commitment to build up gas demand,” said Daniel Yergin, the energy consultant and author, who is visiting Beijing this week.