OAKLAND, Calif. -- Baron Davis got the ball with the clock winding down, glanced to the sideline and saw that coach Don Nelson had no plans for a timeout.
"I just had enough time to set my feet and let it fly," Davis said. "And it went in."
Yao matched his season high with 38 points and grabbed a season-best 18 rebounds, but missed his final two shots in the closing seconds. After one of those misses, Golden State got a final chance, and Davis capitalized for the Warriors' third straight win at home.
"I put the ball in the hands of my best player," Nelson said. "In an open-court situation, he's the boss. I'm not."
Mike Dunleavy's three-point play with 29.3 seconds left got the Warriors within 107-106, then Yao missed on the other end. Yao also couldn't hit a desperation shot at the buzzer. The Warriors tried to wear him down by using several different defenders on him.
"I'm tired, but I just didn't make that shot," Yao said. "An early lead in this game, in the NBA, it doesn't mean that much. ... We still had a chance to win it. In the final 30 seconds, we're up four and they score six points. That's the game won right there."
Davis finished with 34 points and eight assists to lead five Warriors in double figures, but had his stretch of three straight double-doubles snapped. Monta Ellis had 17 points and six assists, and Andris Biedrins added 15 points off the bench for Golden State.
Luther Head had a season-high 26 points and nine rebounds, and Rafer Alston added 19 points, eight assists and six boards for Houston, which kicked off a five-game road trip with a tough defeat. The Rockets are in a stretch where they play 10 of 12 games away from the Toyota Center.
Yao grabbed seven offensive rebounds after not getting one in 2½ games, since the first half at Charlotte on Dec. 8.
Alston and Shane Battier hit consecutive 3-pointers in crunch time to keep the Rockets in it. Yao scored six straight points, including consecutive 12-foot turnaround jumpers, during a 13-0 run to start the third quarter as the Rockets built a 63-52 lead.
Biedrins converted a three-point play with 43.1 seconds left in the third and a technical on Bonzi Wells allowed the Warriors to score four during the sequence, pulling them within 78-73. Dunleavy added two free throws in the closing seconds of the period to make it a three-point game heading into the fourth.
Davis then had a three-point play on the Warriors' first possession of the final quarter to tie it.
The 6-foot-10 Foyle earned a rare start - only his second this season -- for Golden State and had to guard the 7-6 Yao, who didn't attempt his first shot until 3½ minutes in only to have Foyle block it.
"Foyle looked like a point guard trying to play him," Nelson said. "Incredible. What a man, what a man."
Golden State now goes on the road for a six-game, nine-day road trip starting Friday at Phoenix.
"I'm looking forward to it to see how we fare," Nelson said. "It'd be good to play better on the road."
Houston's Tracy McGrady missed his second straight game with back spasms. The Rockets are 9-32 without their star guard in the lineup dating to the 2004-05 season.
Houston missed its first nine shots, three by Yao, and committed four quick turnovers. Head scored the Rockets' first points with a three-point play at the 8:15 mark of the first quarter.
- Biedrins didn't start for only the fifth time this year, two nights after the 20-year-old made all seven of his field-goal tries and went 6-for-6 at the line.
- The Rockets are 1-5 on the road against the Western Conference.
- Houston coach Jeff Van Gundy wants to see more intensity from second-year F Chuck Hayes. "Sometimes he's going to get in foul trouble. He's aggressive by nature," Van Gundy said. "I'm more concerned about a lack of sustained energy for a three- or four-game period."
- The Warriors sold out Oracle Arena for the second time this season.