The photostability of polyamidoimide (PAI) and polyimide (PI) films has been studied. UV irradiation caused a great change in the composition and structure of the film surface. With irradiation in atmospheres such as air, oxygen, and an oxygen—nitrogen mixture, the Cls spectrum had a distinct structure at high binding energy, and the O/C and N/C ratios were considerably increased. On the other hand, in nitrogen and under vacuum, the O/C and N/C ratios remained almost unchanged during an earlier stage of irradiation, but in the latter stage for the nitrogen atmosphere these ratios decreased to a broad minimum and then increased with an increase of irradiation time. UV irradiation also produced free radicals in the polymer films; PAI gave a much stronger ESR signal intensity than PI. The signal intensity vs. irradiation time curve was strongly influenced by irradiation atmospheres. In atmospheres containing oxygen the curve exhibited a broad maximum during an initial stage of irradiation, while under vacuum and in nitrogen the signal intensity increased greatly in the latter stage. The formation of free radicals during an earlier stage of irradiation in atmospheres containing oxygen was promoted by the oxygen incorporated at the film surface, while the radical production under vacuum was considered to be due to rupturing of bonds in the bulk material. The decay of free radicals in the dark after irradiation occurred at a faster speed in oxygen atmospheres than under vacuum.