The Maniac is an opponent who seems to play every hand, and when he enters a pot he does so betting, raising, or re-raising regardless of what he holds. Players may do this out of ignorance or drunkenness; however you may just be facing a shark employing a carefully formulated strategy to dominate a table. You will have to figure out what type of maniac you are facing and defend yourself accordingly.
Against maniacs you should loosen up your starting hand requirements a little, but you should still maintain your solid game, attacking aggressively when you hold a prime hand. This, like most things, can be easier said than done. Maniacs are irritating at the best of times, they have the ability to put you on tilt, raise your blood pressure, and ultimately make you make stupid plays. Don't ignore the Maniac and try to steer clear of him otherwise he'll be taking you blinds unnecessarily.
If you maintain your discipline from his table assault there's a good chance that you'll be able to overcome your foe. The main thing that you'll want to do is to stand up to the Maniac with your premium holdings, preferably in isolation.
The maniac's starting hand requirements will be considerably looser than your own. We know this because he's getting involved in a lot of hands, nobody gets great cards all the time, so almost certainly the Maniac is playing what you would call marginal hands. Therefore you should have confidence in the hands you do play, but don't be lulled into a false sense of security, even maniacs catch good cards sometimes.
Isolating the maniac is of paramount importance, everyone at the table will be wary of him. This usually means that you and the other players will only be playing their premium hands. Therefore if you are in a multi-way pot with the Maniac, there's a great chance the Maniac will be beaten, but a chance your holding will be too. It's important to put more money in when you bet or raise with a premium hand to isolate him. If isolating him fails then you must play more conservatively when you have a marginal hand in a multi-way pot. For instance in a normal ring game it becomes a profitable move to try and draw to straight or flush in a multi-way pot as often your pot odds will be huge. However when playing a maniac, you never really know what your effective odds will be as the betting can get wild. Of course, if you hit your flush/straight you will take down a massive pot, but the ingenious maniac should be aware of this and will control your odds accordingly. Before you know it you'll be pot committed on the turn facing pot odds of a even money to complete your flush on the river. Not a nice prospect!
Overall you should just try to keep your head and raise your game, not being dictated to by anyone. Poker is a war and a battle of the minds; you'll encounter many different styles at the felt. If you want to be the best, you're going to have to learn from all your opponents and develop your own strategies against players. Of course, if you want to make money you can go find an easier table, but if you're in a tournament, you've got nowhere to hide. Although I don't play like a maniac often I give big respect to players who do. For me it's the most interesting style of poker and often produces the most interesting and entertaining characters at the table. As long as the banter is lighthearted and the aggressiveness is done in the betting and not the talking you'll have to accept that Maniacs are here to stay. You might as well start formulating your own strategy sooner rather than later.