Yet this act is a staple of Indian cuisine. The key is knowing what spices in what forms can take how much heat. Whole pods of cumin or peppercorns for example can benefit from browning without the entire structure burning.
Or as I like to say (especially when a friend is apologizing for serving slightly charred food): More colors more flavors!
Blast them on high heat and you drive off most of them, and polymerize the rest to creosotes.