They use gas chromatography.. THC is extracted thoroughly with a non polar solvent, then the mix would be vacuum filtered to collect all the solvent/solute from the plant material..
Gas chromatography is all about separating components of a substance.. Its essentially a high tech refluxing still..
When compounds reach the end of the column they are separated and can be measured..
A known quantity of a substance called an internal standard will be added for quantitative measure.. This substance should be molecularly similar to the compound of interst.. I've read of 4-Androstene-3,17-dione being used for THC.. So by comparing the results of the mixture of the two similar components against known quantities of the pure internal standard, potency can be calculated..