Hundreds of firefighters battled blazes that charred thousands of acres of forest and rangeland in several western states yesterday, killing two lumberjacks, destroying dozens of homes and burning out cars and telephone lines.

The blazes, sparked by dry weather and lightning, struck in Washington, Oregon, Idaho, California, Utah, Montana and New Mexico. Smoke filled valleys and prompted the National Weather Service to issue a warning to drivers and people who have respiratory problems.

Planes and helicopters dropped fire retardant and airlifted reinforcements, bulldozers carved out fire lanes, and Army troops joined in the effort to help control a blaze near a military firing range.

Rescue workers yesterday found the bodies of two loggers who died trying to salvage equipment from a fast-spreading fire near Roseburg, Ore.

"The fire came up the hill to them," said Douglas County Undersheriff Ray Duncan. "It appeared they crawled under one of the loaders to escape the flames."

The Oregon blaze had burned 7,000 acres by yesterday afternoon, destroying eight homes and closing a state highway. "It was a firestorm. You couldn't have done that with 100 flame throwers," said Frank Ruble, looking at a burned hill near his home in Milo.

Ruble and his wife found apples roasted on their trees, but their house was left standing. Ruble said firefighters left a note on the kitchen table saying, "Thank you for the four Cokes we took from your refrigerator."

Oregon Forestry Department spokesman Jim Fisher said about 400 people and 22 bulldozers were on the fire lines, helped by overcast skies and diminished winds. Authorities said people had caused the blaze, but they did not know if it intentionally had been set.

A 900-acre fire in Spokane, Wash., destroyed 24 houses and damaged 12 others yesterday before it was contained. More than 400 firefighters fought the blaze, and three persons suffered minor injuries.

At the height of the blaze Wednesday night, cars exploded and fire leaped across streets, witnesses said. Authorities believe it was sparked by a tree branch that had blown onto a power line.

Also in Washington, 450 people fought an 800-acre fire in Okanogan National Forest, and Canadian authorities provided air tankers to help fight an 1,100-acre blaze near Tonasket.