The 32-year-old batted .255 with 17 home runs, 23 doubles, 51 RBIs and 13 stolen bases in 105 games for the Texas Rangers last season.
With the Rays, Gomez likely will move into the right-field job vacated when Steven Souza Jr. was traded to Arizona last month.
The deal completed Saturday also includes a provision for $500,000 in performances bonuses based on games played: $100,000 each for 80, 90, 100, 110 and 120.
A two-time NL All-Star, Gomez has hit .256 with 133 homers and 504 RBIs over 11 seasons with the Rangers, New York Mets, Minnesota Twins, Milwaukee Brewers and Houston Astros. His 17 homers a year ago were the most he’s hit since 2014, when he had 23.
Gomez also brings playoff experience to his new team, having appeared in the post-season with the Twins in 2009, Brewers in 2011, Astros in 2015 and Rangers in 2016.
To make room on the 40-man roster, the Rays designated infielder Ryan Schimpf for assignment.