Ranney was in the corporation counsel for the city from 1855 to 1857. He was a member of the
Massachusetts House of Representatives in 1857, 1863, and 1864 and served as a
Republican in the Forty-seventh, Forty-eighth, and Forty-ninth Congresses (1881–1887). He failed
reelection in 1886 to the Fiftieth Congress. He then resumed the practice of law until his death. ==Personal life==