Selective laser spectroscopy of activated crystals and glasses