On 22 Aug 1861, Rice joined the 14th Massachusetts Infantry and was commissioned a captain. He was soon transferred to the 19th Massachusetts Infantry Regiment to command Company F. With that unit he was engaged in the Civil War battles of: Ball's Bluff, Siege of Yorktown, Fair Oaks, Savage Station, Glendale, and Malvern Hill. He was promoted to the rank of major on 7 Sep 1862 and fought at Antietam later in September 1862, and the Battle of Fredericksburg December 11–13, 1862. For his actions at the Battle of Gettysburg in repelling Pickett's Charge, he was presented with the Medal of Honor in 1891. Made a lieutenant colonel 28 Feb 1864, he commanded his regiment in the Rapidan Campaign, the battles of Bristoe Station, Blackburn's Ford, Robinson's Cross Roads, and the Mine Run. He commanded the 19th in the Battle of the Wilderness on May 5–7, 1864 and at the battle of Laurel Hill on May 8, 1864. He was wounded and captured in the assault at the Battle of Spotsylvania Court House, May 12, 1864. While being transported as a prisoner on May 23, he escaped by cutting the door of a freight car and jumping from it while the train was moving at 15 mph. He reached Union lines, near the Ohio River, twenty-three days later. He was promoted to colonel on 28 July 1864.