Erlotinib is used to treat certain types of non-small cell lung cancer that has spread to nearby tissues or to other parts of the body in patients who have already been treated with at least one other chemotherapy medication and have not gotten better. Erlotinib is also used in combination with another medication (gemcitabine [Gemzar]) to treat pancreatic cancer that has spread to nearby tissues or to other parts of the body and cannot be treated with surgery. Erlotinib is in a class of medications called kinase inhibitors. It works by blocking the action of an abnormal protein that signals cancer cells to multiply. This helps slow or stop the spread of cancer cells.