If you play the card Masquerade, and you have zero cards in hand, library and discard, what happens? I assume the person to your left will still have to pass a card along. Do you have to pass a card from play (potentially the Masquerade itself), or does the player to your left receive nothing, essentially reducing his or her deck by one card?
Out of interest, how did you reach the position of having zero cards in hand, library and discard?
Anyway, the answer is fairly simple, I think. Consider the following section of the rules, qualifying the action of "draw 5 cards from your deck":
If there still aren't enough cards to draw/reveal, he just draws/reveals what he can.
It seems clear that Dominion follows the same rules philosophy as, for instance, Magic the Gathering: if you cannot fully carry out an action, carry out as much of it as you can.
First, you try to draw 2 cards. You can't, so instead you draw 0 cards.
Next, you try to pass a card left. You can't, so you don't, though you probably do receive a card from your right.
Next, assuming that you were passed a card, you have the option to trash it.
As thesunneversets said, if you have no cards in hand and in your deck when you play dominion, you do not pass a card, but your opponent still has to. This is the key to the dreaded king's court / masquerade lock.
to quote dominionstrategy.com:
The key lies in trimming your deck down to where you have a four-card hand of King’s Court, King’s Court, Goons, and Masquerade. Playing King’s Court – King’s Court – Goons reduces your opponent to 3 cards; here, playing a (Kinged) Masquerade forces him to pass you a card. But since you have no more cards in hand, you aren’t obliged to pass him anything, and thus you can basically trash cards out of his hand. Played consistently, you can force your opponent into a 0-card hand every turn while you empty some non-terminal piles for VPs. Eventually, all the cards in their deck will be trashed, hopefully before the piles are run out.
The basic ingredients are 2 king's court, goons/militia/ghost ship/outpost, and masquerade.
If these cards are in the kingdom in a 2-player game, the first to get the right combination usually wins the game, no matter how many provinces the other already has.
Setting it up is easier than you may think, if you aggressively use masquerade to trash cards, or have another trasher like chapel to help.
Even if your opponent buys 7 provinces while you set up this combo, once you have it running, your opponent will lose all their victory cards, start every turn with 0 cards and will only be able to buy copper or curses.
Once he has zero cards, you can deplete piles, and get some victory points on the last turn.
Only chance the other player has is getting a huge lead in vp chips before the lock hits, since vp chips cannot be taken away, and your own possibilities to gain vp while executing the combo are strictly limited.
Donald X, the creator of dominion has this to say about the combo:
I did not see the King's Court / Masquerade combo in playtesting. I'm sure the cards must have come up, I mean I played those sets together, but I never noticed the combo or saw it done. It is on the subtle side. [...] If you see a crazy thing once in a blue moon, I think that's great. If King's Court / Masquerade is a three-card combo, i.e. if you have to specifically have X Y or Z to make it work (okay a 2.8-card combo or whatever), then I think it's just a cool thing. It won't come up often; when it does you can be the person who spotted it and made out. We have a crazy game and then move on to the next one.
Masquerade has received errata in the Second Edition of Dominion: Intrigue. The new text is:
Each player with any cards in hand passes one to the next such player to their left, at once. Then you may trash a card from your hand.
Because of this wording, if you have no cards in hand when Masquerade is played, you will not receive any cards either. Because of this change, the given answer is no longer correct; and the infamous King's Court / Masquerade pin no longer works.
Dominion Online also uses all Second Edition cards and rules.