Resonance ionization spectroscopy of thorium