In the frequency range from 16 to 50 THz, the transmission, reflection, and absorption spectra of arrays of heterogeneous Ni/Co, FeNi/Co, and Ni/Fe nanowires grown in track polymer membranes by the galvanic method have been studied. The absorption spectra showed that the fraction of the radiation power absorbed by the nanowires and its spectrum depend on the materials of the nanowires. The features of the spectra can be explained by the accumulation of nonequilibrium spin due to electron diffusion and its relaxation stimulated by external terahertz (THz) radiation, which can be used to create a THz radiation detector. In addition, negative absorption was found for FeNi/Co nanowires, which can be explained by the laser effect on spin-flip transitions, which can be used to create a THz radiation source operating at room temperature. Keywords: nanowires, THz radiation, THz spectroscopy, spin-flip transitions, metamaterial.