There are quite a few things you can try to do when helping someone having panic attack; talking, touching, holding and humor to name a few.
At the same time, there are things you shouldn't do as well, as these can upset or anger the person, causing them to feel worse.
Helpful Things You Can Do
Talk to them - Talk and stay with them. Try to help keep them calm. They can still think and talk, despite what they're going through. Ask them if there's anything they want or need.
Reassure them - Let them know that they are handling it well. Tell them you'll be there for them and it's going to end soon. Tell them not to fight it but to just let the feelings be there and accept it. Fighting it makes it worse.
A human touch - Touch them, even hold them. Even if you're a man and the other person is a man, feel free to hold their hand. It can be very powerful to them. The human touch is amazing in the moment of a panic attack .
Use humor - From my personal experience, I found humor to be helpful. I used to shout to my friend, Make me laugh, say something funny." See how they react. If you see them smile, go with it. If not, leave it. A moment's laughter can help a panic sufferer. These tips should make helping someone having panic attack a little easier on you.
What You Shouldn't Do!
Don't freak out! - Whatever you do, try to remain calm yourself. Allow them to weather the storm. If you panic (different panic!) yourself, you're not helping them.
Don't get angry - Do not be mad with them (this is particularly for partners). It's not their fault and they didn't do it on purpose. They're having a panic attack which has to run its course. Don't get angry and make it worse for them. Think of them, not yourself.
Never say this - Don't ever tell them you know how they feel, or that you understand because you don't. Unless you've had them yourself, you have no idea whatsoever.
Also, never tell them to get over it or to snap out of it. A panic attack is terrifying. They are going through terror. Don't put them down, unless you're stupid and have no feelings.
By helping someone having panic attack, you are doing a wonderful thing for them. Be there in their moment of need. They will be grateful.
Though this page is meant for non-sufferers, here are a couple of resources that may be of help to panic attack sufferers.