In the most simple models strings are subject to quantization of vibration modes. Each mode has a frequency and therefore an energy just like the usual modes of the one-dim. quantum harmonic oscillator. Therefore each mode corresponds to a certain vibration energy E which then corresponds to a certain rest mass m defined by E = mc².
Solving this problem for strings is rather difficult (even for non-interacting, bosonic strings w/o compactified extra dimensions), but the result is indeed an energy spectrum and therefore a mass spectrum. Only the lowest modes correspond to massles particles, the higher vibration modes correspond to massive particles; the mass scale is determined by one free parameter of the theory.
I am extremely amateur in the realm of physics and have only recently taken up reading about it because it has captivated my imagination. I would like to read more about quantum harmonic oscillator. Can you recommend something to get started?