 He was the assistant district attorney of Albany County, New York 1865–1867, the collector of internal revenue from 1871 to 1874, and the district attorney of Albany County from 1874 to 1877.Bailey was elected as a Republican to the Forty-fifth Congress to fill the vacancy caused by the death of Terence J. Quinn representing the sixteenth district of New York; and was reelected to the Forty-sixth Congress.He served from November 5, 1878, to March 3, 1881, and was not a candidate for renomination in 1880.