 The son of Elizabeth and William Gray, he graduated Harvard University (1809) and went on to be John Quincy Adams's private secretary, a member of the Massachusetts House of Representatives, and president of the Boston Athenæum.Gray was elected a Fellow of the American Academy of Arts and Sciences in 1819, and a member of the American Antiquarian Society in 1820.When he died, he left many gifts to Harvard, including his collection of 3,000 engravings and $50,000 (equivalent to $ today) to be put towards a museum of comparative zoology.