Rayner was commissioned into the Duke of Wellington's Regiment, in which he served as a signals officer. He was seconded to the Royal Flying Corps in 1916. During the First World War he served on the Western Front and India. He was seconded to the Indian Army in 1917, transferred in January 1919 and served in the Third Afghan War, for which he was made a Member of the Order of the British Empire. He transferred to the Royal Corps of Signals in 1926. Between July 1928 and January 1930 he was ADC to the Marquess of Willingdon, Governor General of Canada. He was promoted captain in 1919, major in 1932 and retired in 1933. He then entered politics and was Member of Parliament (MP) for Totnes from 1935 to 1955. He rejoined the Army during the Second World War and reached the rank of brigadier.