Foil is that shiny stuff your mom wraps your tuna fish sandwiches in before she shuttles you off to school. Or that pointy thing you stab people with in fencing.
A foil is a character whose main purpose is to offer a contrast to another character, usually the protagonist. Foils set off and accentuate the main character and are convenient ways to complicate and deepen the characterization of the protagonist. Basically, everything the foil is, the protagonist is not. The foil's differences highlight the key qualities of the main character.