Andre Johnson caught eight passes for 118 yards and Foster scored for the fifth straight game for the Texans (7-1), who clamped down on defense in the second half to put the game away.
Williams had a sack and five tackles in his first game at Reliant Stadium since signing a six-year, $100 million contract with the Bills (3-5) in the offseason. The Texans made Williams the top overall pick in the 2006 draft and he's still Houston's career sacks leader (53). But Williams became an unrestricted free agent after last season, and the Texans opted against breaking the bank to keep him and let him go.
|More on Bills-Texans|
|2012 NFL Week 9|
|More NFL coverage|
Williams said this week he was upset that Houston general manager Rick Smith never even made him an offer to stay. After the game, though, several Texans and coach Gary Kubiak embraced Williams at midfield.
Schaub won for the 10th time in 11 starts. He completed 19 of 27 passes for 268 yards. The Texans looked much better in the second half, outscoring Buffalo 14-3 and holding the Bills to 119 yards after halftime.
Williams got his first dose of boos when he tackled Foster on Houston's opening drive.
Schaub started Houston's third series with an 18-yard pass to Kevin Walter. Foster gained 14 yards before Schaub executed a smooth play-action fake, rolled to his left and hit Owen Daniels in stride for a 39-yard touchdown.
The Bills mustered only 35 yards and one first down in the opening quarter. C.J. Spiller gained 28 yards on a screen pass to the Houston 19, but Buffalo came away empty after Connor Barwin sacked Ryan Fitzpatrick and Rian Lindell shanked a 37-yard field goal attempt.
Foster crossed midfield with a 21-yard run early in the second quarter and Houston was on the move again.
Williams then sacked Schaub and wagged his finger at the Houston sideline, prompting more jeers. Buffalo defensive tackle Alex Carrington blocked Shayne Graham's 46-yard field goal try with 6:22 left in the first half. Carrington also blocked a field goal try in Buffalo's 19-16 win at Arizona two weeks ago.
Fitzpatrick completed 10 of 11 passes in the second quarter to rally Buffalo. But the Bills faced a fourth-and-2 from the Houston 4 with 1:45 left before halftime, and Buffalo coach Chan Gailey played it safe, sending in Lindell to kick a 22-yard field goal. Lindell tacked on a 38-yarder just before the break to make it 7-6.
The Texans' third-ranked defense showed better form in the second half. Fitzpatrick started the third quarter with three straight incompletions, and rookie Keshawn Martin returned the ensuing punt 26 yards to the Buffalo 43.
Schaub completed a 34-yard pass to Johnson to the Bills' 4-yard line, and cornerback Aaron Williams hurt his right knee making the tackle and left the game. Foster scored two plays later, his 11th touchdown of the season. After the game, Aaron Williams left the Bills' locker room on crutches.
Lindell kicked a 39-yard field goal with 7:41 left in the third quarter. The Bills failed to convert six of their first eight third downs.
The Texans put the game away on their next drive, marching 68 yards in 6 1/2 minutes. Johnson caught two passes to go over 100 yards for the 40th time, and Schaub rolled right and found tight end Garret Graham for a touchdown.