After the war Rayski remained in the military. Promoted to the rank of Lt. Colonel, he briefly became the commanding officer of the Higher Pilot's School at Poznań's airfield of Ławica. However, he gave up that post in 1922 and instead returned to Lwów, where he continued his studies halted 8 years before. He also remained an active aviator and gained much fame in Poland after several of his spectacular flights. In 1925 in four days he flew the Paris-Madrid-Casablanca-Tunis-Istanbul-Warsaw trail, a remarkable achievement at that time. In August 1924 he was promoted to the rank of Colonel and sent to a course for high-ranking officers at the Higher War School of Warsaw. At the same time he collaborated with the Aviation Department of the Ministry of Military Affairs, where he became the deputy to Gen. Armand Lévéque. On 18 March 1926, shortly before the May Coup d'État, he was made the chief of the department and a "de facto" commander of the Polish Air Force.