Smoke from the Camp Fire in Butte County blanketed the Bay Area on Friday, making the air more hazardous than notoriously smoggy Beijing’s and prompting officials to warn people to avoid going outside.

Schools in several districts canceled classes because of the smoke. Pedestrians wearing masks and scarves on their faces were common sights on city streets, as people did what they could to avoid breathing the small, hazardous particles contained in wood smoke.

“We’re going to have smoke throughout the day and probably into early next week due to the weather pattern,” said Kristine Roselius, a spokeswoman for the Bay Area Air Quality Management District. Forecasters see no fundamental shift in the weather over the next several days, and in fact warned of a possible return of fire-watch weather in the Bay Area this weekend.

The agency rated Bay Area air quality as “unhealthy.” It advised people to limit their time outdoors, keep windows closed and set air conditioners to recirculate.

Winds from the north-northeast will continue to push smoke from the Camp Fire to the Bay Area for several days, officials said. The air will be smokiest in the North and East Bay and in San Francisco, Roselius said.

Dr. John Balmes, who studies air pollutants and their effects on respiratory health at UCSF, said the bad air puts everyone’s health at risk, but especially those with heart and lung diseases. Children also have increased risks because they breathe more rapidly than adults, leading to higher exposure to the polluted air, he said.

The tiny particles in wood smoke are what make it especially dangerous, Balmes said.

“Those fine particles can make it down into the deep lung and they can cause harm to people with pre-existing heart and lung disease, people with asthma, chronic obstructive pulmonary disease,” he said. “Those conditions are exacerbated by air pollution like this.”

If going outside can’t be avoided, N95 respiratory masks offer some protection, Balmes said. The name comes from the fact that the masks can filter out 95 percent of the fine particles in wood smoke.

Balmes said he recommends them for those with heart and lung problems and people who must be outside for an extended time.

Children, and men with facial hair, might have trouble sealing the masks around the nose and mouth. But Balmes said that even so, wearing them is better than nothing.

Schools in the most heavily affected areas were taking no chances Friday. All schools in Butte and Sonoma counties closed to keep children and staff from being exposed to the dangerous air. Santa Rosa Junior College, California State University Chico and Butte College also closed and canceled all weekend events.

The local air quality district banned Bay Area residents from using fireplaces, wood stoves or other wood-burning devices through at least Monday.

“We don’t want residents to add to the already polluted air that we have out there,” Roselius said.

Air quality fluctuates depending on the wind, but on Friday it was bad by any standard.

The air quality index, a number that measures air pollutants, hovered between 105 and 152 around the Bay Area on Friday. A healthy level is 50 or lower.

The Bay Area’s numbers were similar to those during the 2017 North Bay fires, which were far closer than the Camp Fire.

By contrast, in Beijing, one of the world’s worst places for air pollution, the rating was 21 early Saturday.

Ashley McBride is a San Francisco Chronicle staff writer. Email: ashley.mcbride@sfchronicle.com Twitter: @ashleynmcb

Where to buy N95 masks

N95 masks, which can screen 95 percent of the small particles found in wood smoke, can be bought at many hardware stores and drugstores. To work correctly, they must be completely sealed around the nose and mouth, so they may not fit properly on children or on men with facial hair.