SAFE ROOMS Keep your pets in a "safe room" until the fireworks are over; preferably an interior room with no windows. If you can't get them into a windowless room, close the curtains so they don't see any flashes. Be sure to keep lights on, as a dark room might make the loud noises doubly frightening.
Make the room as familiar, homey and comfortable as possible: set up pet beds and provide food, water and toys (as well as a litter box, if it's a cat). If you think noises might relax them, turn on the TV or play some music to distract them; maybe a CD with soothing nature sounds.
Remove sharp objects, decorative items or anything else that could injure them if they get scared and start running around and knocking things over. If they scratch or bite you in a state of panic, stay calm and be gentle but firm. Remember it's up to you to provide a calming, stable presence for them.
While you should never punish a pet for being afraid, try not to coddle them too much, either. That would only confirm their suspicion that something is wrong, and thus increase their anxiety. Instead, distract them with games. Give your dog their favorite chew toy, or dangle some string for your cat.