SALMON, Idaho (Reuters) - Firefighters gained ground on a wildfire threatening the ski resort town of Sun Valley, Idaho on Tuesday as evacuation orders were lifted for hundreds of homes and officials said they had "turned the tide" against the wind-whipped blaze. Blaine County Sheriff Gene Ramsey told occupants of 725 homes in upscale developments south of the twin towns of Sun Valley and Ketchum that they could return but should be prepared to leave again at a moment's notice. That reduced to 1,125 from a high of 2,250 the number of houses still under a mandatory evacuation order in the path of a fire that has prompted the Sun Valley ski resort to keep flames at bay by turning on water cannons usually used to make snow. "I think the tide has turned in our favor today," said Blaine County spokeswoman Bronwyn Nickel. Lower temperatures and higher humidity levels allowed firefighters to attack the fire directly instead of being on the defensive, said fire information officer Richard Reuse. The fire has strained the area's tourism economy at the height of a summer season. Elite firefighting units, known as hotshots, worked on the ground while helicopters dropped fire retardant on a flank of the fire that had advanced on Ketchum and crews protected homes that have been guarded by fire engines. But fire managers said they were making headway because of lower temperatures, higher humidity levels and sustained ground and air operations that began on Sunday. "We do feel pretty optimistic," said Beth Lund, incident commander with the U.S. Forest Service team managing the blaze. She said the fire might be as much as 50 percent contained in the coming days. The Beaver Creek blaze is one of dozens of fires raging across Western states that have strained Forest Service resources because of federal budget cuts. Meanwhile, in Northern California, a wildfire that broke out on Saturday has destroyed two homes and authorities asked occupants of 2,500 residences west of Yosemite National Park to leave, said Jerry Snyder, spokesman for the Stanislaus National Forest. The blaze increased by tenfold on Tuesday, growing from 1,000 acres on Monday to 10,000 acres. The roadway can still be used by residents and recreationists seeking to leave the forest through the park. More than 450 firefighters were battling the so-called Rim Fire, which was raging out of control across parched brush, scrub oak and pines in steep, rocky terrain that was difficult for crews to access, Snyder said. In Yellowstone National Park, officials closed a 7.5-mile stretch of the park's main road under threat by a 4,500-acre wildfire. Visitors have been asked to take a detour around Old Faithful geyser to reach Mammoth Hot Springs and other attractions north of Yellowstone Lake, park officials said. Elsewhere in Idaho, authorities lifted an evacuation order for 65 homes in the path of an 8,000 acre blaze near the mountain town of Atlanta, east of Boise. Editing by Dan Whitcomb and Christopher Wilson