it's got nothing to do with the crystal emitting energetic waves
what happens is they take a sample of the crystal....beam a laser at it of a fixed wavelength...the structure and components of the crystal then change the energy state of the laser and thus change its wavelength...they can then detect these changes...
different molecular structures and elements changes the wavelength to different extents either making the laser more energetic or less...what actually does this is the bonds between the atoms because they act in different ways...some stretch...some bend...some twist around
here's what i mean by that
you can then identify what the crystal is composed of by looking up data tables of known tested molecules