To cumbersome separation of the very fine photocatalyst particles from the treated water, uniform, homogenic, and well‐adhered immobilized cobalt‐modified bismuth oxide thin films were deposited on glass substrates using the pulsed spray pyrolysis technique. The parameters of films deposition were optimized using the response surface method (RSM). Three preparation variables, namely, the time of deposition, the temperature, and the Co‐ratio have been studied to investigate their effects on the degradation rate constant of ofloxacin as a response. Furthermore, structural, morphological, and optical properties of the deposited films were measured by X‐ray diffraction, field emission scanning electron microscope, and UV–Visible spectrophotometer, whereas the photocatalytic activities were investigated by degradation of ofloxacin as a model pharmaceutical water pollutant. The experimental results showed a maximum rate constant of ofloxacin degradation of 0.092 , which is in a good agreement with the predictable results obtained from RSM. Therefore, RSM optimized successfully the spraying parameters to have the best film for use in the treatment of water pollutants.