The deal, which is pending a physical, is the largest free-agent contract in Rays history, topping the five-year, $35 million contract that pitcher Wilson Alvarez received before the team's inaugural 1998 season.
Before reaching agreement with Eflin, the Rays were the last remaining team in the majors to never have committed more than $35 million to a free agent, according to ESPN Stats & Information research. There now are two teams left -- the Oakland Athletics and Pittsburgh Pirates -- that have never spent $40 million on a free agent.
Eflin, 28, became a free agent after turning down a $15 million mutual option for a $150,000 buyout from the Philadelphia Phillies, completing a $5.7 million, one-year contract.
Last season, Eflin went 3-5 with a 4.04 ERA, striking out 65 in 75⅔ innings. He pitched 4⅓ scoreless innings in relief in the World Series, with the Phillies losing in six games to the Houston Astros.