A Foil is a character who contrasts with another character (usually the hero) in order to highlight various features of that other character's personality by throwing those characteristics into a sharper focus. Usually, the foil and the hero will differ drastically from one another. For example, in a comiedy duo, the "straight man" is the foil. While the straight man is reasonable and level-headed, the other man in the duo is pretty much universally funny, dumb, or simply unorthodox.
In dramatic storytelling, the foil is often an antagonist of some sort. For example, Draco Malfoy from J.K. Rowling's Harry Potter novels is a foil to the hero. Not only is Malfoy cowardly, selfish, and cruel where Potter is brave, kind, and giving, he's also physically different from Harry Potter in that he's tall to Harry Potter's short height, he's blonde-haired to Harry's black, and so on.