What about marks put on boarding passes at security? Granted sometimes it's just a swipe of a black pen. No problem. But I believe I've seen stamped marks a few times. I'm assuming the friend's ticket would be in your pocket and the friend wouldn't be there to go thru security before passing it on....
I find this an interesting discussion though. I wouldn't want to be identified as traveling under someone else's name though. Illegal or not, I don't imagine a night of fun with security.