Who are Hamlet's foils, and in what ways do their characters shed light on his?
A foil is a character who is like the protagonist in some respects but who has contrasting qualities that "reflect" or illuminate the traits of the main character. (Act 4)
One of the foils to Hamlet is Laertes, they are similar in age and situation though of course Hamlet has more of a direct path to the throne, etc. Laertes is also interested in being off at college, he really cares for Ophelia as does Hamlet, and he is an accomplished swordsman.
But Laertes is also a man of action, he responds immediately to situations. He leaps into Ophelia's grave, he is desperate to find a way to avenge his father's death and Claudius actually has to slow him down and get him to consider things a bit more. On the other hand, Hamlet is always considering everything at incredible length rather than just acting. Laertes serves to bring out this incredible inaction on Hamlet's part.
Another obvious foil to Hamlet is young Fortinbras. He too has lost his father and it is revealed in Act 1 that is trying to regain the lands his father lost to King Hamlet in a battle they had years ago. The time is right for this action because King Hamlet is dead and the kingdom is in a time of mourning and transition to the new king, Claudius. He is driven to accomplish his goals. This is revealed by the fact that he didn't gather a formal army, but he "sharked up a list of lawless resolutes" to be his enforcers. While it is reported in Act 2 that he will back down if he is allowed safe passage through Denmark to fight for lands further east, it is not the last Hamlet hears of Fortinbras. In Act 4, Hamlet has a chance to talk to one of Fortinbras' soldiers and he learns that Fortinbras is leading his men to fight over a piece of worthless land in Poland. The land is not worth anything, but the honor of restoring it to the control of Fortinbras is the worth the effort and loss of men. Hamlet is struck by this determination and it spurs him be more determined in his own mission for revenge against Claudius.