What is a Foil Character?

A foil character in a story is a character which is used to contrast the main character of the story. The foil character usually has opposite traits than the main character.