The Texans led 10-9 when Tim Boyle threw a 10-yard touchdown pass to Johnny Johnson III on the second play of the fourth quarter to make it 17-9.
Houston quarterback C.J. Stroud and Rams QB Matthew Stafford weren't even in uniform for this one as most starters from both teams sat out.
Houston third-string quarterback Case Keenum started with Stroud and backup Davis Mills not playing Saturday. He led the offense on Houston's first two possessions before Boyle took over.
Cam Akers, a former Ram fighting for a roster spot with the Texans, ran for 53 yards and had 19 yards receiving. He had a career-best 786 yards rushing with seven touchdowns for the Rams in 2022.
Dresser Winn played the entire game for Los Angeles and was 9 of 16 for 72 yards. Zach Evans ran for 45 yards and two touchdowns for the Rams. His 3-yard run with about three minutes left cut the lead to 17-15. But he was stopped short of the goal line on the 2-point conversion attempt.
The game was tied at 3-3 after both teams made field goals in the first quarter. The Texans made it 10-3 when Boyle connected with Troy Hairston on a 5-yard touchdown early in the second.
Los Angeles cut the lead to 10-9 when Evans scored on a 4-yard run about seven minutes before halftime. Rookie Joshua Karty's extra point was no good after it bounced off the upright.
Stafford and backup Jimmy Garoppolo didn't play this preseason. Stafford, who has missed practice time recently with a tight hamstring recently and is also dealing with a cut on his left thumb played extensively Thursday when these teams held a joint practice.
Third-stringer Stetson Bennett didn't play Saturday after getting all the QB snaps in the first two preseason games. Sean McVay said that Bennett will serve as Stafford's backup for the first two regular-season games with Garoppolo suspended for those games for violating the NFL's policy on performance-enhancers.
Xavier Hutchinson, who is vying for one of Houston's last receiver spots, led the team with four receptions for 34 yards.
The final preseason game comes as L.A.'s starting left tackle Alaric Jackson was suspended for two games for violating the NFL's personal conduct policy. The exact reason for the suspension remains undisclosed.
Jackson will be eligible to return in week 3.
Looking ahead to the regular NFL season, Rams quarterback Matthew Stafford is expected to be ready for the season opener against the Detroit Lions despite a recent hamstring issue.
The Associated Press contributed to this report.