How to comfortably interact with famous professors?
From a student's point of view, here is how I tackle the situation. You can break it down by the circumstances in which you meet, and thus guesstimate how much time the professor has for you.

Asking "may I talk to / email you later about...?" can be useful if it's not the right time and place for a useful discussion.

DTK's answer has good points about how you should approach a conversation.

Of course there will be some variations depending on the culture and environment of your department, and how well you know the prof you're talking to.

Hallway / elevator encounters

If they look busy or rushed, perhaps best save it till later. Otherwise, keep questions very brief, concisely answerable, and related to something you know they're interested in (i.e. their own research field).

Discussions at semi-social occasions, such as at a gathering after a seminar, or breaks at a conference

Here, the professor probably has no immediate obligations or things urgently pressing on his or her mind (or else they'd have disappeared by now). This is a better opportunity to ask broader or more complicated questions, or if they work in a related field you could ask for an opinion on a problem you've been thinking about.

Social occasions such as at lunchtime, conference dinner, etc.

As above, but they may even prefer to talk about something other than their own field of expertise -- sports, politics, an interesting paper from a completely unrelated discipline that you read whilst procrastinating, etc. If you don't know the professor very well, you might want to wait for him or her to initiate steering the conversation in that direction.