Bayly was the youngest of three sons and third of five children of Thomas Bayly and Ann Drummond Bayly. He was born on March 26, 1775, at his father’s Hills Farm plantation in Accomack County, educated at Washington Academy in Somerset County, Maryland, and graduated from the College of New Jersey (now Princeton University) in 1794. He returned to Accomack County, where he farmed his Mount Custis plantation, practiced law, and on February 24, 1802, married Margaret Pettit Cropper. They had four daughters and five sons; the fourth son, Thomas Henry Bayly, served in the House of Representatives from 1844 to 1856. After his wife died on December 3, 1823, Thomas M. Bayly married Jane Addison on December 21, 1826. They had two daughters and a son.
Bayly was elected to the House of Delegates as a Federalist in 1798 and was reelected twice, serving until 1801. In 1801 he was elected to the Senate of Virginia to represent Accomack and Northampton counties. He was reelected in 1805 and served until the end of his second four-year term in 1809. In April 1813 Bayly ran against Republican Representativefor the congressional seat for the district composed of the city of Williamsburg and the counties of Accomack, Elizabeth City, Gloucester, James City, Matthews, Middlesex, Northampton, and Warwick. Bayly’s well-known opposition to the war with Great Britain aided him in an election characterized by a high voter turnout on the antiwar Eastern Shore and an unusually low level of voting in Bassett’s strongholds west of the Chesapeake Bay, occasioned in part by the presence of enemy warships. Bayly won the election by a slim margin of fifty-seven votes. Bassett contested the election with the assertion that the poll had been illegally kept open too long in Accomack County, resulting in a greatly inflated vote total for Bayly. The Republican majority in the House of Representatives ruled that Bayly’s margin of victory had been obtained illegally, but it did not unseat him in favor of Bassett.
In spite of his opposition to the War of 1812, Bayly of necessity took part in the defense of Virginia, serving in the field in 1814 as lieutenant colonel of the 2nd Virginia Militia Regiment. Bayly did not seek reelection to Congress in 1815, preferring instead to devote his attention to his family, his plantation, and his law practice, but he returned twice more to the House of Delegates, serving from 1819 to 1820 and again from 1828 to 1831. In May 1829 he was one of four candidates elected to a state constitutional convention from the district composed of the counties of Accomack, Gloucester, Matthews, Middlesex, and Northampton. During General Assembly debates in February 1829 on the bill for calling the convention, Bayly had endorsed some of the reforms that members from the western counties advocated, including extension of the suffrage to more adult white men and a reapportionment of the seats in the assembly to reduce the dominance of the small counties in Tidewater Virginia. During the convention he continued to support these changes, although he voted with opponents of most of the other reforms proposed. Bayly voted for adoption of the generally conservative constitution that the convention submitted to the voters early in 1830.
By the time he made his will in 1828, Bayly had debts large enough that he set aside the profits of some of his land for five years to satisfy them and ordered that other properties be sold. He then had extensive holdings on the Eastern Shore and in Ohio and Illinois. Bayly died on January 7, 1834, at Mount Custis and was buried in the family cemetery at Hills Farm.