(picture from - The Panel Report - www.powerfulpanels.com )
If you are invited onto the program it's incumbent on you to prepare. Very few of us are spontaneously great. I'm certainly not. As I said in my BristolCon report - I'm a slow thinker and naturally laconic. And I don't think that's unusual for writer types. However with some notes in front of me, and having thought about the topic in detail up to a week in advance of the Con I'm a competent panelist. (I hope)
The worst thing you can say is - "I don't know why I'm on this panel" - because a) there may be someone in the audience who was desperate to be on the panel, but was passed over so you could be on it instead and b) the audience is there to be entertained and if you've got nothing to bring to the conversation, why the hell are you there?
If you don't know why you've been picked to be on a panel the time to ask is before the Con and the people to talk to are the program organisers. Not to do so as you sit on stage and wonder out loud, to a group of people who have paid to be entertained.
On a similar note - do some research, have a think about the kind of things the moderator is likely to ask you and have some prepared answers. And write notes. My memory isn't the best under normal circumstances and it's no surprise that you may go blank under the stage lights, with lots of people looking at you.
If you're moderating you have to work twice as hard. Not only do you have to research the subject but you should research your panelists and you are the one that should do some work up front before the Con even starts. You're the one to keep things on topic (unless it's a wildly entertaining tangent) and to make sure that everyone is taking part. If someone on your panel hasn't said a word for half an hour, you are a bad moderator. Equally if someone has talked for fifteen minutes solid and no-one has managed to get a word in edgeways, you are not doing your job. It's hard to interrupt people but you have to spot the gaps and dive in, sweeping another panelist with you if possible.
If you are on a panel - either as a moderator or a panelist then you should check out the "how to" sections - most Cons have them. BristolCon's "How to be a panelist" (which you'll see covers pretty much the same as above) is great as a basic introduction.
Don't get into defining genre. This is quite annoying, and happens remarkably often. If it's the Squid-Punk panel, don't spend half of it trying to define what Squid-Punk is. Defining genre is pretty tricky, not interesting to watch and doesn't usually advance the topic.
As the moderator you should keep your eye on the clock too. The Con may provide minions with "5 minutes to go" type boards, or they may not. But it's your responsibility. It's always a good idea to set the audience expectations with regards to questions too. A lot of people want to be part of the conversation and will waffle on with their opinions if they are allowed. Sometimes this can be interesting, often it isn't.
Remember that the people in the audience have paid to be there. They want to be entertained and they want to be part of the conversation (and many of them will be when asking questions).
Proper planning prevents piss poor performance.
The most important tip though is - have fun!