The spectra of secondary particles resulting from interactions of primary galactic cosmic rays with the nuclei in the atmosphere have been calculated using the Monte Carlo transport code FLUKA. The simulations have been carried out at solar minimum and solar maximum activity, for several values of the vertical geomagnetic cut-off. The effective dose rate and the ambient dose equivalent rate as a function of geomagnetic cut-off and altitude have been obtained using appropriate sets of conversion coefficients. The calculated results are discussed and compared with experimental data and other calculations. A simple method is proposed to calculate the radiation exposure at aircraft altitudes.