The teams announced the deal Friday, the last day that players can be traded and be eligible for the postseason.
Gearrin has combined to go 2-1 with a 3.51 ERA and one save in 56 relief appearances this season with Texas and San Francisco. He began the season with the Giants and was traded to the Rangers in July.
The acquisition adds depth to an already formidable A's bullpen.
Gearrin's versatility figures to be a valuable asset, A's manager Bob Melvin said.
"You would envision more of a matchup righty-righty guy, but he's shown the ability to get lefties out," Melvin said. "He can pitch a couple of innings, he's got a funky arm slot. The ball moves a lot.
"I know he's excited about being here. I talked to him for a while today. He said, 'I'll do whatever you ask me to do.;"
The 19-year-old Mendoza was 2/3 with a 3.32 ERA at Class-A Vermont. The 18-year-old Ortega is 3-1 with a 2.11 ERA in the Dominican Summer League.
The A's also transferred right-hander Paul Blackburn to the 60-day disabled list to clear a spot on the 40-man roster.