@lluviaporos: You're only partially right. Not all gems can be heat treated. Depending on whether the air in the kiln is reducing or oxidizing, you can change the color, lighten or darken a stone depending on what kind. The heat allows for rearrangement of the crystal lattice and "heals" fractures, resulting in increased clarity.
Heat treatment is undetectable in some stones. In others, a microscope is one of several things needed. Looking at refraction patterns and reflected light using various light filters are usually better diagnostic tools.