sentence: on december 6 , 2006 , the cubs agreed to a four-year , $ 40 million deal with free agent pitcher ted lilly , who played the previous season for the toronto blue jays , beating out the new york yankees , while hendry was being hospitalized for chest pains .