We theoretically study the propagation through a resonant absorbing medium of a time-dependent perturbation modulating the amplitude of a continuous wave (cw). Modeling the medium as a twolevel system and linearizing the Maxwell-Bloch equations for the perturbation, we establish an exact analytical expression of the transfer function relating the Fourier transforms of the incident and transmitted perturbations. It directly gives the gain and the phase shift undergone in the medium by a harmonic modulation. For the case of a pulse modulation, it enables us to determine the transmission time of the pulse center-of-mass (group delay), evidencing the relative contributions of the coherent and incoherent (population) relaxation. We show that the group delay has a negative value (fast light) fixed by the coherent effects when the cw intensity is small compared to the saturation intensity and becomes positive (slow light) when this intensity increases, before attaining a maximum that cannot exceed the population relaxation time. The analytical results are completed by numerical determinations of the shape of the transmitted pulses in the different regimes.