Rayski initially wanted to stay in the Legions, which were commonly seen as a school of cadre of future armed forces of Poland, but was convinced by Gen. Kordian-Zamorski to go to Constantinople and try to obtain experience in air warfare.
Immediately afterwards he bought a single LVG C.V plane and flew across the Black Sea to Odessa, where he joined the Polish 4th Rifle Division under Gen. Lucjan Żeligowski.
There he was made the commanding officer of that division's improvised air escadrille, equipped with 9 planes (apart from Rayski's LVG these were a single Nieuport 11C1 and eight Anatra Anasal DS).
Although the Polish forces managed to seize dozens of World War I planes from the defeated Central Powers, there were not enough pilots to fly them.
Rayski was chosen as the commander of that unit not only for his skills as a pilot, but also for his language abilities, as the squadron was manned primarily with American volunteers.
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.
However, in the post-war period the Polish air forces were neglected as Marshal Józef Piłsudski and his predecessors underestimated the role of aeroplanes in modern warfare.
Because Poland could not afford to purchase a large number of modern planes abroad, Rayski promoted the development of Polish aviation industry.
In 1928 on his insistence all Polish aeroplane factories switched their production to modern all-metal constructions, which allowed the new generation of young and skilled engineers to start their career.
The plan was based on extensive study of the development of the German Luftwaffe and on theories of Italian general Giulio Douhet, who envisioned that the future war would be fought primarily with bomber planes, with fighters playing a secondary role.
The new commander of the air force cancelled most of Rayski's projects, including the successful PZL.37 Łoś bomber, whose production was to be limited from the initial number of 180 to merely 120.
Some historians, most notably Jerzy Cynk, consider Rayski as one of the most responsible persons for the poor technical state of the Polish Air Force before the war, especially lack of modern fighters.
The Inspectorate itself was not interested in military aviation much and was reluctant to work out a modern development plan for the Air Force and an appropriate strategic doctrine, giving only general directives instead.
Therefore, Rayski had no knowledge on the Polish Air Force expected wartime role and as a result, he realized his own conception, without proper assessment of real needs.
He promoted obsolete PZL.39 project, that was not realized, and the PZL.38 Wilk, a twin-engine heavy fighter-bomber, of a fashionable at that time class, but unable to substitute for interceptor aircraft.
Facing fiasco of both designs, Rayski finally ordered development of PZL.50 Jastrząb, which was hampered by his arbitrary choice of too weak engine, and appeared too late and mediocre.
[7] Other point of criticism was that Rayski, realizing his vision of strong national aerospace industry, intentionally caused bankruptcy of Plage i Laśkiewicz factory, while the DWL hardly avoided this fate.
However, the British authorities postponed the delivery of the Hawker Hurricane, Supermarine Spitfire and Fairey Battle planes and on 15 July Rayski returned to Poland with little but promises.
Ordered to report to the military camp in Carisay, Rayski refused, for which he was court martialled and sentenced to 10 months in prison for insubordination.
On 1 June the Legion sent him to French Air Forces for training, but before it could commence France surrendered to Germany and Rayski fled to Great Britain.
There, on 5 September he asked both the British authorities and Gen. Władysław Sikorski to be allowed to join the Royal Air Force as a simple pilot.
On 5 November, on insistence of Air Chief Marshals Sir Cyril Newall and Charles Medhurst he was set free and in 1941 he was admitted to RAF Ferry Command units, transporting planes between allied airfields in Asia and North Africa.
He led a variety of transport missions, including a remarkable flight of a formation of Bristol Blenheim bombers from Habaniya in Iraq to Singapore.
301 Polish Bomber Squadron stationed in Brindisi, and flown a number of supply missions for the Armia Krajowa fighting in German-occupied Europe, both on Supermarine Spitfire and on B-24 Liberator.
In early April 1977, Rayski - then already heavily sick and dying - was finally acquitted of all the charged presented to him in 1940 by an honorary commission of the Polish Government in Exile led by Gen. Zygmunt Szyszko-Bohusz.