In literary terms, what is a foil?

AThe character who tries to prevent the main character from resolving the central conflict of the story.
BA character who clashes with the main character in order to reveal the main character's traits
CThe character who is trying to achieve a particular purpose and who is usually the main character
DA character who is usually a commoner and uses his or her wits to outdo people of higher social standing