The Tampa Bay Rays and infielder Yandy Díaz agreed Tuesday to a three-year, $24 million that avoided a salary arbitration hearing.