Barber received his commission as a U.S. Army officer and his pilot's wings on October 31, 1941. He joined the 70th Pursuit Squadron, which arrived at Guadalcanal, Solomon Islands, in December 1942. Flying a Bell P-39 Airacobra, he scored his first victory by downing a Japanese bomber on the 28th. Upon transfer to the 339th Squadron, he began flying P-38 Lightnings and claimed two Zero fighters on April 7. On April 18, Lieutenant Barber figured prominently in the Yamamoto interception, also known as Operation Vengeance. Intelligence sources had learned that Yamamoto would be flying in a "Betty" bomber on an inspection tour of Japanese bases in the northern Solomon Islands. Historian Donald P. Bourgeois credits Barber with the sole kill of Yamamoto's aircraft. In 1991, Barber and Captain Thomas George Lanphier, Jr. were officially credited with half a kill each in Yamamoto's bomber after the Air Force reviewed the incident. Barber also shared a second Betty destroyed on the same mission. In 2003, Barber was credited by the Governor and Legislature of Oregon with the sole kill after an inspection analyzed the crash site and determined the path of the bullet impacts, thereby validating Barber's account and invalidating Lanphier's claim. However, despite numerous appeals, the US Air Force refused to reverse its 1991 ruling giving each pilot half credit for the kill. Lanphier also claimed to have shot down a Zero fighter during this mission, although Japanese records show that no Zeros were lost. After his tour of duty ended in June 1943, then-Captain Barber requested a return to combat. Late that year, he joined the 449th Fighter Squadron in China, still flying P-38s. He claimed three further Japanese planes probably destroyed and damaged, but he was shot down on his 139th mission, bailing out near Kiukiang on April 29. He was rescued by Chinese civilians, who treated his injuries and escorted him to safety five weeks later. At the end of the war, Barber attained the rank of major and commanded one of America's first jet squadrons. He retired as a colonel in 1961.
Upon his military discharge, Barber returned to Culver, Oregon, and resided there for the next forty years. He worked as an insurance agent and, at different times, served the city of Culver as mayor and judge. He was a strong supporter of Little League Baseball, and often helped out local youth. He was actively involved in service organizations until his death at his home in Terrebonne, Oregon. His son, Rex Jr., is quoted as saying that his "afterburner just flamed out on him."