The interaction of oxygen gas atmosphere with CdS films prepared by spray pyrolysis is studied. Spray time and deposition temperature are taken as variable parameters. The prepared film structure is characterized by XRD to elucidate the film crystallinity nature and size. Both thickness and crystallite size of the CdS films decrease as the deposition temperature increases from 340 to 490 degrees C at constant deposition time. The opposite trend was observed when the films are deposited at different deposition times and constant deposition temperature. The films are exposed to different concentrations of oxygen and the thinner CdS films show higher sensitivity and a shorter response time than the thicker films. The results obtained are promising to use the prepared films for detecting oxygen.