We present a technique for suppression of wavelength competition in rare-earth-doped fiber lasers and for obtaining simultaneous lasing at tens (up to several hundred) of laser lines with wavelength spacing down to 50 pm. An ytterbium-doped fiber laser is used for experimental demonstration. Spectral selection is based on a built-in Lyot filter whose length can be selected to set suitable wavelength spacing. The measured linewidth for each of the generated lines is less than 100 pm and can be as little as 20 pm. The method for mode competition suppression is based on the gain-switching technique with modulated pump. At certain modulation parameters (amplitude, duration, and repetition rate), the laser generates a stable sequence of microsecond pulses with ∼1 W peak power and ∼4 μJ energy consisting of many longitudinal modes.