Lakers led by three before Battier made consecutive 3-pointers to put Houston on top 100-97 with about 2 1/2 minutes remaining.Bryant made a pair of free throws before Battier hit a jump shot that caused the Lakers' star to slump his shoulders and shake his head. Los Angeles was then called for a shot clock violation and Bryant missed a 3-pointer on the next trip down the court.
Battier was fouled by Derek Fisher on a 3-point attempt with 41.9 seconds remaining and hit all three free throws to make it 105-99. Houston made four free throws in the last few seconds to secure the win.
Bryant approached Battier and patted him on the chest at the end of the game before Battier raised a hand to the crowd and left the court to loud cheers.
It was a big win for the undermanned Rockets, who are playing without center Yao Ming and guard Aaron Brooks, who are out indefinitely with ankle injuries.
Luis Scola had 14 points and nine rebounds for the Rockets, and Chase Budinger and Jordan Hill added 10 points apiece.
The Rockets cut the lead to 93-90 with about five minutes left thanks to Martin hitting all three free throws after being fouled by Bryant on a 3-point attempt. Kyle Lowry followed with another 3-pointer.
Houston led by two points early in the fourth quarter before an 11-2 scoring spurt capped by a 3-pointer by Steve Blake put Los Angeles ahead 89-82.
A layup by Martin tied the game at 66 midway through the third quarter and the teams tied and exchanged the lead several more times in the third quarter. A 3-pointer by Lowry tied it again near the end of the period, but Shannon Brown made a pair of free throws to put the Lakers ahead 78-76 entering the fourth quarter.