The extractor is the part that extracts the spent casing from the chamber upon firing. It is usually spring-loaded, and grips onto the rim of the case.
In breech loading firearms such as manually operated and automatic firearms, the extractor is a component generally found on the bolt head and works in conjunction with a rammer. Extractors have also been used as Loaded chamber indicators.
Another example of extractor exists in the form of a pivoting lever attatched to the bolt head that lacks a separate rammer, but works by ejecting first the rear of the cartridge to exit through the ejection port instead of the case head/bottleneck. This type of component does the job of both extractor/rammer but is mostly found on firearms using simple blowback, lever/tilting bolt locking/delay etc rather than rotating bolts.
Notes[]
On a revolver, the cartridges (which are usually rimmed) rest upon the extractor itself. When the ejector rod is depressed, the extractor pulls the spent cartridges out of the chambers, dropping them once they clear the cylinder.