After his father died, Gray was appointed Houston’s District Attorney on April 24, 1841, remaining in the job until Texas became a state in 1845. He also served the city of Houston as an Alderman and on the local board of health. In 1848 he founded the
Houston Lyceum, which later became the
Houston Public Library. He was elected to the
Texas State Senate in 1854, then served as a State District Court Judge from 1856 to 1861. In 1861, Gray attended the Texas State Secession Convention, and voted to leave the union. In November that year, he was elected to the Confederate House of Representatives. After the war he returned to his law practice in Houston,
Gray, Botts & Baker. In 1874 he quit his practice upon being appointed as an associate justice of the
Texas Supreme Court, but served only a few months before resigning due to declining health. ==Death and legacy==