Femtosecond pulses in a dense two-level medium: Spectral transformations, transient processes, and collisional dynamics