Erlotinib works by blocking the epidermal growth factor receptor (EGFR), a protein on cells that encourages cancer cell growth.