OAKLAND, Calif. -- Somehow, Wade Miley pulled off escape acts all afternoon.
"Houdini," the Red Sox starter said with a smile.
Miley dueled with Athletics ace Sonny Gray and worked out of jams to end a three-start skid thanks to some sparkling defense, and the Boston beat Oakland 2-0 Wednesday to take two of three in the series.
Miley knew he had little margin opposing a guy like Gray.
Facing the A's for the first time in his five-year career, Miley (2-4) allowed the leadoff batter to reach in four of his first six innings. The left-hander won for the first time since April 21 at Tampa Bay, allowing four walks and five hits in 6 2/3 innings.
"He was outstanding," manager John Farrell said. "He was resilient with three innings they were getting a number of guys in scoring position with less than two outs. He never gave in."
Gray (4-1) struck out nine and didn't walk a batter for the first time all season. But the A's dropped to 1-11 in the daytime with their seventh loss in eight games.
Daniel Nava hit an RBI bloop single in the second to snap an 0-for-20 slide and drive in the first run. The Red Sox won on the road for just the fourth time in their last 11 away from Fenway Park.
"It doesn't matter how it falls, as long as it falls," Nava said.
Boston added an unearned run on shortstop Marcus Semien's wild throw to first in the eighth. Oakland has made errors in 11 straight games and a majors-high 36 in all.
Koji Uehara pitched the ninth for his seventh save. Boston won this series without big contributions from the middle of the batting order. Nos. 3-4-5 hitters David Ortiz, Hanley Ramirez and Pablo Sandoval went a combined 5 for 36.
Sandoval hit a winning home run in the 11th inning Monday night but wrapped up his Bay Area return 1 for 12 and was booed whenever he stepped in the batter's box. He received his World Series ring from Giants manager Bruce Bochy on Sunday night.
Ortiz went 2 for 13 this series and is 3 of 20 on the trip. Ramirez singled in the second and ninth for his only hits in a 2-for-11 Oakland stop.
He is beginning to feel right at the plate again after missing three games last week with a sprained left shoulder.
"Getting there," he said. "I'm getting my timing, working on my timing."
Gray, with nine or more strikeouts for the third straight start, was trying to extend his best start to a season. He missed matching his career-best winning streak of six straight decisions dating to his last loss Sept. 23 against the Angels. He has allowed one earned run or fewer in six of his first eight starts.
"I don't know how you can pitch much better," manager Bob Melvin said.
The A's snapped a season-high six-game losing streak in Tuesday night's 9-2 win, but couldn't build momentum to win back-to-back games. That's something they haven't done since their lone winning streak April 13-14 at Houston.
Semien led off the third with a triple but couldn't score. Josh Reddick followed with an infield popup.
"It was horrible offense," Reddick said. "When we get guys in scoring position, we've got to get them in."
Coco Crisp hit an infield single to begin the fifth for his first hit of the year -- snapping an 0-for-26 funk with his first hit in 40 at-bats dating to last Sept. 26 -- before Semien grounded into a double play and Reddick flied out for another missed chance.
MILEY ON THE ROAD
Five of Miley's seven starts have been away from Fenway Park. He owns a 2.68 road ERA in 40 games since the start of 2013.
Red Sox: Boston plans to place RHP Justin Masterson on the disabled list Thursday because of arm fatigue that has caused a drop in velocity in his last two starts, both losses. Steven Wright is likely to take his rotation spot to start Sunday at Seattle.
Athletics: Utilityman Ben Zobrist, recovering from left knee surgery, will continue hitting batting practice and could begin a rehab assignment when the team hits the road following this weekend's series with the Chicago White Sox.
Red Sox: RHP Joe Kelly makes his second career start against the Mariners as Boston concludes its season-long 10-game road trip by opening a four-game series at Safeco Field. He threw five scoreless innings opposite Felix Hernandez in a no-decision last Aug. 22 at Fenway Park.
Athletics: Off Thursday. RHP Jesse Hahn (1-3) looks to end a three-start winless streak in which he has lost his last two starts when the A's open a weekend series Friday against the White Sox.
Fantasy baseball forecaster: Team hitting ratings
Stay ahead of the game and optimize your fantasy baseball hitters with our forecaster, which provides a rolling 10-day outlook of every team's hitting matchups as well as the potential for stolen bases.
Fantasy baseball forecaster: Pitcher projections for the next 10 days
Keep up to date on who is pitching -- and how well they're expected to do -- with our forecaster, which provides a rolling 10-day outlook of every team's probable starting pitchers with game score projections.
Why the Chicago White Sox are MLB's most interesting (and best) team
From a rookie with a burger named in his honor to a manager everyone loves to scrutinize, the South Side of Chicago is home to this season's most intriguing club.
Colorado hosts Cincinnati following Gonzalez's strong showing
Cincinnati Reds (17-18, third in the NL Central) vs. Colorado Rockies (14-24, fifth in the NL West)
Dodgers face the Marlins following Urias' strong showing
Miami Marlins (17-20, fourth in the NL East) vs. Los Angeles Dodgers (20-17, third in the NL West)
Struggling Rangers look to break 3-game losing streak against Astros
Texas Rangers (18-21, fourth in the AL West) vs. Houston Astros (21-17, second in the AL West)