Theory of Generation of Coherent Radiation by a Combination of a Free-Electron Laser and an Active Molecular Medium