Ayers, the son of Jared and Dinah (Benedict) Ayres, was born in New Canaan, Conn, September 11, 1817. He graduated from Yale College in 1837. For fifteen years after graduation he was employed as a teacher as follows in Berlin, Conn. (1837–38), Miller's Place, L. I. (1838–41), East Hartford, Conn. (1842–44), Sag Harbor, L. I. (1844–47), and Boston, Mass (1845–52). He began the study of medicine in Boston, and in 1854 received the degree of M.D. from Yale College. He then removed to San Francisco, Cal., where he remained for nearly twenty years, engaged in practice. He also served as Professor of the Theory and Practice of Medicine in the Toland Medical College in that city. He removed to Chicago shortly before the great fire of 1871, in which he suffered considerable pecuniary loss. About 1878 he returned to New Haven, and opened an office for the practice of his profession. From 1879 he also held an appointment as Lecturer on Diseases of the Nervous System in the Yale Medical School.