Lilly Agrees to Buy Animal Health Firm, Cuts Outlook