Question: A friend of mine (for real, not me) received an offer letter from two tech firms in Silicon Valley. Let's called one X and the other Y.

X's offer letter has a better salary and sign-on bonus. However, my friend prefers to go to Y. Y is willing to match X's salary and sign-on bonus, but wants proof in the form of the offer letter. However, X's offer letter is marked "confidential". My friend did not sign an NDA before going in for an interview.

Under these circumstances,

1. Can my friend share X's offer letter with Y?
2. Does there have to be an NDA signed with X before the offer letter is considered actually confidential?

Answer: 
Confidential does not have any legal weight in most places without a formal agreement. You can't just send someone something and mark it confidential.

But handing it over would be a breach of the company (that actually has given an offer) expectations. And there is no guarantee that the other company will better the offer, they have just 'said' they will.

Generally they shouldn't be asking and you shouldn't be giving. Personally I wouldn't, it's a sign of weakness to acquiesce in a negotiation regarding a matter where your honesty is questioned by demanding proof. And if word got out you share documents given in good faith, that's a terrible reputation to have.
You didn't give any info as to where this (may have) occurred, but as a general principle I think an NDA on a job offer would be difficult to enforce, because the offer doesn't contain anything proprietary or that would be viewed as a corporate secret.
To me, the larger issue is moral or ethical if the interview was intended to be used as leverage to obtain a better offer from another firm.