Ted Lilly, who would have been eligible for free agency after the World Series, instead has agreed to terms on a three-year contract to remain with the Dodgers, a source with knowledge of the situation confirmed Saturday on the condition of anonymity because the deal is contingent on Lilly's passing a physical examination. Terms of the deal weren't immediately available.