Context. Emission lines observed in radially pulsating stars are thought to be produced by atoms de-exciting after being excited by a shock wave that is traveling into and then compressing, heating, and accelerating the atmospheric gas. Aims. With the help of recent observations, we examine the origin of all the different types of emission lines of hydrogen and helium that appear during a pulsation cycle. Methods. To analyze the physical origin of emission lines, we used the different models of atmospheric dynamics of RR Lyrae stars that have been calculated so far. Results. In contrast to a recent explanation, we propose that the redshifted emission component of Hα, which occurs near the pulsation phase 0.3, is produced by the main shock. In this case, the emission is the natural consequence of the large extension of the expanding atmosphere. Therefore, this (weak) emission should only be observed in RR Lyrae stars for which the main shock will propagate far enough from the photosphere. It appears as a P-Cygni type profile. We estimate the shock front velocity during the shock propagation in the atmosphere and show that it decreases by 40% when the Hα emitting-shock passes from the photospheric level to the upper atmosphere. The Hα P-Cygni profile observed in long-period Cepheids also seems to be caused by the main shock wave. Although to date He II has only been detected in some Blazhko stars, a comprehensive survey of RR Lyrae stars is necessary to confirm this trend, so we can say that the most intense shocks will only be observed in Blazhko stars. Conclusions. The development of a model of atmospheric pulsation that takes the effects of 2D and 3D convection into account, seems to be a necessary step to fully quantify the effects of shock waves on the atmospheric dynamics of radially pulsating stars.