Peter W. Gray, legislator and jurist, one of the six children of Milly Richards (Stone) and William Fairfax Gray, was born on December 12, 1819, at Fredericksburg, Virginia. His father moved to Texas in 1835, and his family followed him in the winter of 1838 to Houston, where young Gray studied in his father's law office. As a captain in the Army of the Republic of Texas, Peter Gray participated in the campaign to remove the Shawnee Indians from East Texas in 1839. In 1842 he was elected second lieutenant of the Milam Guards and aided in repulsing the raid of Rafael Vásquez on San Antonio. Upon his father's death in 1841, Gray was appointed district attorney of Houston by Sam Houston. He held this position from April 24 until annexation. On January 25, 1843, he married Abby Jane Avery. He failed in an election bid for city secretary on January 20, 1840, but was elected alderman on November 1, 1841, and was appointed a member of the board of health on May 20, 1844. He was elected in 1846 to the first state legislature, where he was author of the important Practice Act regulating Texas court procedures. In 1848 he became a founder of the Houston Lyceum, which became the Houston Public Library. Largely through his financial support, Henderson Yoakum was able to complete his classic History of Texas (1855), which is dedicated to Gray. Gray was elected to the fourth Senate in 1854 and subsequently served as judge of the Houston district, a jurisdiction stretching from the Sabine to the Brazos, until the outbreak of the Civil War.
Although he had been a strong advocate of annexation to the United States, Gray was a strong states'-rights Democrat and was elected as a delegate to the state Secession Convention, where he voted in favor of taking the state out of the Union. In November 1861 he was elected to represent the Houston district in the first Confederate House of Representatives. There he served on the House Currency and Judiciary committees and the special committee on homesteads for disabled soldiers. As a vigilant guardian of Texas financial interests, Gray secured a separate branch of the Treasury Department for the Trans-Mississippi region. Like most Texans, he favored direct taxation and heavy export duties to support the government and took a keen interest in the Sequestration Acts owing to the fact that much Texas land was owned by absentee Northern interests. At the same time he supported a strong central government, favoring, for example, nationalizing of the Confederate railroad system. He was a friend and confidential advisor of Jefferson Davis, as well as a supporter of conscription and exemption from the draft of overseers of slaves. Gray was defeated in his 1863 reelection campaign by Anthony Martin Branch. At the end of his term he became a volunteer aide to Gen. John B. Magruder and served at the battle of Galveston. In 1864 President Davis appointed him fiscal agent for the Trans-Mississippi Department, a position that he accepted with some reluctance. He was unsuccessful in raising funds to retire the Confederate debt in the region and thus left Gen. Edmund Kirby Smith's army virtually without financial means through the final months of the war.
After the war Gray returned to his Houston law practice, which he built into one of the largest in the South, and was elected first president of the Houston Bar Association in 1870. In 1873 he toured Europe. In 1874 Gov. Richard Coke appointed him associate justice of the Texas Supreme Court, upon the resignation of William P. Ballinger, but Gray resigned within two months, on April 18, due to worsening pulmonary tuberculosis. He died in Houston on October 3, 1874, and was buried in the Glenwood Cemetery. In 1876 the Texas legislature named Gray County in his honor. Gray reportedly assumed his middle initial, which stands for no other name, in later life. He was a devout Episcopalian, a charter member of Christ Church in Houston, and an active Mason.