"Just relax and get a good pitch to hit and not chase," Carter said. "That's all I was trying to do there."
The Astros have won six of their last seven and are 11-6 in their past 17 games, giving interim manager Tom Lawless three wins in his first three games at the helm since replacing Bo Porter.
"It's a lot of fun," Lawless said. "These kids are great, and you know they play hard and that's all I ask of them. Just come play hard and have fun."
Carter's 36th homer of the season -- his seventh of the season against the A's, his former team -- was his 23rd since July 4. Of the 10 homers allowed by Samardzija with the A's, Carter is responsible for three of them.
"We had many opportunities to put that game out of reach before that even happened, and we didn't capitalize," A's catcher Derek Norris said. "You let teams hang around long enough, they're going to come through and they're going to beat you, and I think that's more so the focal point for me than the pitch to Carter. We had multiple, multiple opportunities to score more runs and we didn't."
Tony Sipp threw the final two innings, striking out four of the seven batters he faced, to get his third save. Chad Qualls, who has struggled against the A's, was warming up in the ninth, but Lawless liked the matchup with Sipp against a pair of switch-hitters to start the ninth.
"We had a big powwow in the dugout, talking about what we're trying to do at the end," Lawless said. "They match up so much over there and they flip their lineups all the time with the guys they have, and we just felt that the left-hander out there was the best option tonight."
Astros left-hander Brett Oberholtzer (5-10) held the A's to seven hits and three runs in 6 1/3 innings to win for the first time since Aug. 2. The A's tagged him for three runs in the third, an inning which began with a comebacker that bounced off Oberholtzer and went for an infield hit. There were two walks and an error by Jake Marisnick in right field following a bloop hit, as well.
"That's just baseball," Oberholtzer said. "They put the ball in play and we weren't able to make some of the plays, and that's all right. I had to regain focus one pitch at a time."
Oakland, leading 3-2, loaded the bases with no outs in the fourth inning, but Oberholtzer got Craig Gentry to hit a grounder to third baseman Matt Dominguez, who got the out at home. Josh Donaldson then hit into a 5-2-3 double play to end the threat.
"That was huge," Oberholtzer said. "I think that was the breaking point, or the point in the game that was going to make or break us. We were able to escape that on two ground balls to Matty and that was huge."
Jose Altuve's second hit of the game -- and his 196th of the season -- came with one out in the sixth, and one out later Carter sent his mammoth shot over the wall to give the Astros a 4-3 lead. Carter's 85 RBIs are a career high.
"It helps when that little guy's on first base too because he's buying Chris some fastballs," Lawless said. "By not stealing there early in the count, Samardzija is going to after him with heaters because he didn't want Jose to steal. That's why I say it was a team effort, because all those little things add up."
Samardzija (4-5) struck out nine batters and allowed four runs and six hits in seven innings, giving up a solo homer to Jon Singleton in the third inning after sending down seven in a row to start the game.
"The long ball bit me today," he said. "That's really the best way to put it. Singleton hit the one out, and then Carter. You can have a great day out there and feel really good, and in this league everyone can hit, everyone's getting paid to play ball, and a couple pitches can jump up and bite you. That's what happened tonight. I had great stuff, loved what I was offering out there. Just, like I said, two I'd rather have back."