Rasmus' game-winning hit came two innings after he popped out to end the seventh, stranding runners at the corners.
"That was a tough one, they walked Edwin (Encarnacion) in front of me and things didn't go my way," Rasmus said. "It wasn't the easiest at-bat."
When he came up again in the ninth, Rasmus wasn't about to go chasing anything.
"I went up there telling myself I'm looking for a cookie and I'm not swinging at anything else until I have to," he said.
Rasmus slumped badly in the second half of last season, but has remained solid this year. He's batting .366 over his past 25 games and said he's doing a better job of wiping the slate clean after poor performances.
"I just try to focus on ways to get things off my mind and off my chest, let some things go that bother me and just come back the next day as a fresh day," he said.
Rajai Davis stole a career-high four bases as the Blue Jays won for the third time in four games against Houston, owners of the worst record in the majors.
Encarnacion was intentionally walked to bring up Rasmus, who bounced a single over the mound and up the middle as Bonifacio scored standing up.
"We had opportunities and we couldn't capitalize and it came down to the big hit out of Colby late," Blue Jays manager John Gibbons said.
Casey Janssen (3-0) worked one scoreless inning for the Blue Jays, who rebounded against Houston after being swept in consecutive series against Tampa Bay and the Los Angeles Dodgers.
"It's huge," Rasmus said. "We've got to put together as many wins as we can, just keep battling, keep grinding."
Blue Jays rookie right-hander Todd Redmond struck out a career-high 10 in six innings, the longest of his five career starts. He allowed one run, three hits and two walks.
Astros right-hander Jarred Cosart gave up one run and four hits in six innings, walked a career-high five and struck out one.
"Today I was just out of synch on my windup," Cosart said. "I'm working on some stuff and I threw that out today, just trying to get through the game."
Cosart allowed at least one base runner in every inning, but was able to minimize the damage.
"His fastball command was definitely not there today, there were several walks but he did a great job," Astros manager Bo Porter said. "Defensively we backed him with some really good plays."
Houston's top pitching prospect, the 23-year-old Cosart took a no-hitter into the seventh of his big league debut at Tampa Bay on July 12, earning the win against reigning AL Cy Young Award winner David Price.
After stranding three runners in the first two innings, Toronto broke through in the third when Jose Reyes drew a leadoff walk, moved to third on a single and a fly ball and scored on Encarnacion's sacrifice fly.
Houston tied it in the fourth on a one-out solo shot by Brett Wallace, a former Blue Jays minor leaguer. The home run was Wallace's sixth of the season.
Encarnacion led off the bottom of the sixth with a drive to deep center and went into his home run trot as he rounded first. Outfielder Brandon Barnes threw the ball back after it appeared to bounce off the wall, and no home run was called. Gibbons came out to argue and the umpires huddled before checking the replay, but upheld the original call.
Crew chief Joe West said the umpires reviewed at least 10 replays, trying to find the best angle, but ultimately agreed the ball had hit the wall.
"The only reason we went and checked was because when the ball went into the shadow we couldn't see exactly where it hit," West told a pool reporter.
Maicer Izturis drew a one-out walk and Encarnacion went to third on Davis' fielder's choice, but both runners were stranded when Josh Thole grounded out.
Toronto came up empty again in the seventh, leaving the bases loaded and losing designated hitter Bautista after he was ejected for arguing with home plate umpire Sam Holbrook.
Houston reliever Josh Fields left after Encarnacion was intentionally walked to load the bases. Travis Blackley came on and got Rasmus to pop out.
Davis drew a one-out walk in the eighth and pinch-hitter J.P. Arencibia followed with a drive to center, but Barnes made a leaping catch against the wall.
"We did a lot of good things, we just didn't do enough to win the ball game," Porter said.
After Cisnero came on to face Lawrie, Davis stole second and went to third on Carlos Corporan's second throwing error. Lawrie walked but Reyes flied out to end the inning.
Bautista's ejection was his second of the season. ... There was a video tribute before the fifth to mark the 22nd anniversary of former Montreal Expos pitcher Denis Martinez's perfect game. Martinez is now Houston's bullpen coach. ... The family of late Blue Jays broadcaster Tom Cheek received the Ford C. Frick Award in a ceremony Saturday at Cooperstown's Doubleday Field.
Copyright by STATS LLC and The Associated Press
TORONTO, CANADA - JULY 28: Todd Redmond #58 of the Toronto Blue Jays delivers a pitch during MLB game action...