 Ray was the solicitor for Coos County, New Hampshire from 1862 to 1872.He twice served as a member of the New Hampshire House of Representatives in 1868 and, again, in 1869.He was a delegate to the Republican National Convention in 1872.