Kennedy was released by St. Louis last week, leaving the Cardinals' starting job up for grabs heading into spring training. He's scheduled to make $4 million this season, but the Rays would only have to pay him the major league minimum $400,000 if he makes the team.
The Cardinals, who signed the 33-year-old to a $10 million, three-year deal before the 2007 season, would be responsible for the rest of the salary.
"We talk a lot about depth. I think this move fits perfectly in line with that," Rays executive vice president of baseball operations Andrew Friedman said. "He's a tremendous defender, does a lot of things well. We're anxious to watch him play on a daily basis."
Tampa Bay's regular second baseman, Akinori Iwamura, will miss the start of spring training because he's working out with Team Japan in preparation for the World Baseball Classic.
Kennedy, expected for the Rays' first full-squad workout on Wednesday, hit .280 with two homers and 36 RBIs in 115 games last season. He requested a trade after the Cardinals acquired Felipe Lopez in August.
A .276 career hitter, Kennedy made his major league debut with St. Louis in 1999. He was traded to Anaheim, where he helped the Angels win the World Series in 2002, and returned to the Cardinals as a free agent two years ago.
Rays manager Joe Maddon is familiar with Kennedy from his days as a coach with the Angels.
"I don't know what happened in St. Louis," Friedman said. "But Joe's got a history with him and speaks extremely high of him as a teammate and competitor and feels like he'll add a lot to our group in the clubhouse."