I think you mean James F. Ranson, rather than John. His full name was James Francis Madison Ranson and he was son of James Lackland Ranson and Frances Madison Hite.
James was born 14 May 1833, died 6 Mar 1899 in a drowning accident.
He was an attendee of VMI (Virginia Military Institute) along with his brother Ambrose Robert Hite Ranson, Sr. He entered VMI July 8,1851 and resigned July 9, 1852.
Info from VMI: He was a Private, 1st Md. Artillery; Appointed 1st Lieut. to Gen Pegram's Brigade; Wounded in Action Sept. 22, 1864, crushed skull. [Wounded so bad he was presumed dead and tossed into a corpse filled wagon, but someone touched his hand and noticed he was still warm] He never fully recoved from war wounds.
I had seen a website for the reenactors of this unit which shows a John F. Ransom as a Corporal on the original officers page. A 2nd page has a roster and it says Jno. F. Ranson was Corporal. But, I believe all the evidence points to him actually being James.