Precipitating solar energetic particles (SEPs) ionize the atmosphere. They produce NO x and HO x which in turn destroy ozone. Here, we present Monte-Carlo simulations of the SEP interaction with the atmosphere. Compared to continuous energy loss models, the Monte-Carlo method leads to a shift of ionization to lower altitudes because secondaries, in particular X-rays produced by electron bremsstrahlung, are considered. In addition, the inclusion of ionization by solar electrons leads to modifications in ion production profiles with the magnitude of the effect depending on the properties of the parent solar event. Implications of our results for atmospheric chemistry modeling are briefly sketched.