Hays was elected as a Democrat to the 27th United States Congress, serving from 1841 to 1843, and made an unsuccessful bid for reelection in an adjoining district in 1842 when Virginia lost a congressman in as a result of losing population in the 1840 census.
However, Hays again won election to the Virginia House of Delegates, this time representing Braxton and Lewis Counties.
During his Congressional term, Hays sponsored the admission of Thomas "Stonewall" Jackson as a cadet to the military academy at West Point, and also urged the building of the Parkersburg-Staunton Turnpike.
Hays, Joseph Smith, John S. Carlile and Thomas Bland also represented Randolph, Lewis, Barbour, Gilmer, Braxton, Wirt and Jackson counties as their delegates to the Virginia Constitutional Convention of 1850, which gave more representation to the western counties.
President James Buchanan, a fellow Democrat, had appointed him Receiver of Public Moneys and Hays continued as such until Buchanan's presidency ended in 1860, at which time Hays resumed farming near what was then the administrative center of the new state of Minnesota.