The Dodgers declined to extend Gagné's $12 million contract after the season, making him a free agent. On December 12, 2006 Gagné signed a one-year deal with the Texas Rangers worth $6 million, with a possible $5 million in performance bonuses. Gagné had a poor spring training, allowing five earned runs in only three innings of work. For the third consecutive year, Gagné was placed on the disabled list to start the season to let him recover from his injuries. Gagné started to make his recovery by tossing in three minor league games, two of them on consecutive days, allowing a home run and having one loss. In his last minor league game, Gagné retired all three of the batters he faced, and he was activated on April 13. In his first week back, Gagné pitched three innings, earning one save. But in the middle of his second save situation, Gagné left the game after complaining of leg pain. He said that it would take about a week to recover from the injury, but the Rangers, not taking the risk, placed Gagné on the disabled list with a hip injury. He was reactivated on May 8 and returned to the closer role. During his time with Texas, he was 2–0 with 16 saves and an ERA of 2.16; opposing hitters batted only .192 against him. On July 31, 2007, Gagné was traded to the Boston Red Sox for pitcher Kason Gabbard and minor league outfielders David Murphy and Engel Beltré. Gagné was expected to serve as a setup man for closer Jonathan Papelbon. Theo Epstein was quoted as saying that "I think the bullpen is already a strength of the club, but acquiring a pitcher the caliber of Éric Gagné only makes it stronger and helps give us what we hope will be a truly dominant bullpen for the remainder of the year." However, Gagné struggled in his new role with the Red Sox. In his first 15 appearances, Gagné allowed 14 earned runs in 14 innings (a 9.00 ERA) with three blown saves and an opponent batting average of over .350. Gagné seemed to improve down the stretch and was eventually added to the playoff roster. In the playoffs, he was most often used in games in which the Red Sox were winning by a wide margin, including his only World Series appearance in which he pitched a perfect ninth inning in a 13–1 Game 1 victory.