Interband and intersubband optical transitions in quantum wires are studied theoretically with allowance for scattering of carriers by both long-wavelength acoustic vibrations in a homogeneous magnetic field with the strength vector H of which is directed perpendicularly to the nanostructure axis. The features of the absorption spectra of a weak electromagnetic wave with an increase in the magnetic field are studied. In particular, it is shown that new channels of light absorption appear for interband optical transitions in the presence of a magnetic field. With an increase in the magnitude of H, absorption maximums are shifted to the region of higher frequencies; in this process, distances between the absorption bands increase. For intersubband optical transitions, frequency dependences of light absorption coefficients are calculated and analyzed with allowance for light polarization (linearly and circularly polarized light). Conditions under which processes of carrier scattering on a rough surface have a significant effect on optical characteristics of nanowires are discussed.