Dwyane Wade scored 19 points for the Heat, who shot 47.6 percent from 3-point range (10 of 21) and 51 percent from the field overall.
Chandler Parsons scored a career-high 25 points and Omer Asik had a career-best 19 points and 14 rebounds for the Rockets, who led 110-106 with 90 seconds left.
James went 3 for 4 from the free throw line over the next minute, then drove for the go-ahead layup with 19 seconds left.
Jeremy Lin shot an airball from 3-point range with 10 seconds left, Wade caught it and the Heat escaped with their sixth straight win over Houston.
Source: Associated Press