I want to share a couple of stories of authors I've had some excellent interactions with, but first, I need to lead up to it. I don't want to give the impression that I'm advocating you harass, stalk, or feel entitled to an author's time. Some authors are friendly, and will welcome your approach no matter how inept. Others are introverted, tired, or socially awkward.
If there's one thing I want you to walk away from this post with, it's that authors are human, too. Being published doesn't make someone automatically better, smarter, or prettier than you. It also doesn't revoke their humanity or right to basic human decency. Being in the public eye doesn't mean that all attention is welcome.
You may be scoffing at the above statement because it's so blindingly obvious. You, clearly, have never witnessed some of the behavior I have.
In any case, assuming you're looking for pointers about how to get a good interaction out of your favorite author, or you need some confidence to work up the nerve to approach your writing idol, the below is my advice consisting of what worked for me.
Approach when the author is going to have free time. Conventions or other places where your favorite author is going to be plunked down a while are the best avenue for this approach; if the author's running off to another signing or to catch a plane, your potential interaction is doomed to failure. No matter how polite you are, if someone doesn't know you, he won't change his plans for you.
Have no agenda in mind. If all you want is an autograph, go to a signing. If all you want is to hear the person speak or you have a particular question, go to a lecture, a convention panel, or send an email. You'll do much better if it's clear you're not asking in order to get something. Your reward, if it works, is an awesome story and having basked in the presence of someone you admire.
Be aware of the author's comfort zone. Don't isolate authors from people they know. Don't stand too close, or extend the invitation more than once. Accept "no" for an answer, and make it clear you value their comfort and safety. That may entail inviting people you don't know, and sharing your authorial experience with strangers. It also means not suggesting anywhere secluded, dimly lit, or that corners the author. Whatever your intent, it will come off as creepy if you're not aware of how your invitation might look to someone who may have been stalked, threatened, harassed, or otherwise received unwanted attention. Because authors talk to one another, word will get around that you're "the creepy one."
Pick some things to talk about. The best conversation topics are the spontaneous ones, but you should have some conversational gambits that don't revolve around the person's writing. Many authors do like to talk about it, but writing is their job. Would you want to talk about your job all through dinner? Don't talk politics, religion, or Picard vs. Kirk, because chances are good the author doesn't agree with you, and someone's feelings will get hurt.
Above all, be respectful. Say nice things because they're nice, and true. Listen. Assume the words out of the author's mouth are truthful. Don't take things personally if it doesn't go as well as my interactions. Don't get belligerent when the author doesn't match your expectations; take that as a cool bonus.
Obviously, your results will vary, depending on who you want to interact with. You're probably not going to have the chance to invite Neil Gaiman or Stephen King to dinner, unless you know someone he knows.
Part 1 - Dinner with a fantasy writing icon
Part 2 - Dinner with the Princess of the Kingdom of Poison and Flame