Ryan drove in Casper Wells with a single to right off Jim Miller (2-1) to break a 2-2 tie. Wells had opened the frame with a single and then stole second.
Charlie Flatbush (4-1) pitched out of a jam in the eighth inning to notch the win in relief of Jason Vargas, who struck out 10 Oakland batters over 6 2/3 innings but also gave up two runs, which kept him from claiming the decision.
Tom Wilhelmsen picked up the save with a perfect ninth inning.
Yoenis Cespedes had a solo home run in the eighth and Jonny Gomes followed with an RBI single later in the inning that tied the score 2-2.
The A's lost for just the fourth time in their last 14 games.