The Tampa Bay Rays and free agent Ha-Seong Kim have agreed to a two-year contract valued at $29 million, a person familiar with the negotiations told The Associated Press on Wednesday.