There are a number of ways you can handle this, and I'll try to break them down for you:
- Roach Work
- Baneling Style
- Infestor Harassment
- Brood lord
- Back Dooring
Roaches are what many people consider the Marine's natural Enemy. With high HP (almost 3 times a Marine) and that 1 base armor its not surprising people would believe this. Unlikely in Starcraft 1, Marine's can't upgrade their attack range, so the shorter range of the Roach is punished less. The biggest issue you have to worry about with Roach based play is where you engage your opponent. Ideally you want to engage on open ground, on creep, and with a nice arc. Try to remember that because of the Roaches' short range remember to "move" into melee range, instead of "attack move."
Baneline Style is very popular against MMM in general, and usually used to compliment Roach or Hydra work. If you initially engage with your Roaches (in more Marauder based play you'd use Hydralisks here), and then bring in Banelings from the side or behind (flanking in military terms), you can usually make quick work of any Marine based force. Remember you never attack with Banelings, as they explode on death to do damage. Instead just "move" near the Marine force and let the Marines kill them off. I cannot stress how important baneling speed upgrade is against a Marine force, even on creep.
Infestor Harassment is also a nice compliment to dealing with Marines. While Medivac will heal most of the damage quickly, in the middle of a fight, Infestors can prevent Marines from backing up, while dealing incredible dps (9*#of marines). They are an excellent compliment to a Roach or Zergling based strategy. If you're dealing with Infestors alone, remember that it will usually require 2 Fungal Growths to kill a pack of Marines; where "usually" is influenced by the use of Stim and the presence of Medivacs.
If you're coming from a late game Air strategy it'll make more sense to use Broodlords. Brood Lords are effective because of their high damage, and because Broodlings draw fire from Marines. Because Broodlords are slow, its normally useful to engage from the edge of a cliff, where few Marines can hit you. Unless you have a very large number of Broodlords, this kind of play is unlikely to be effective on its own, and is best complimented with a cheap ground force (something ling based).
Backdooring is usually an effective technique for shutting down late game Terran pushes. Terran style tends to be fairly turtle dependent, so most Terran players will run for their base when ever its in trouble. You can leverage this with Muta Harass, Zergling Drops, or even Nydus Canal. The very fact that you are in his base will often make a Terran call off his assault, giving you more time to prepare.
With the exception of the last strategy, all these strategies are what I like to call "meat and potatoes" strategies. They have some method for killing the Marines and some method for distracting them. This is because Marines are extremely cost effective dps and once they hit critical mass, almost impossible to destroy for a short range based Zerg force. You strategy should look something like this: I need something for him to hit (let's say Ultralisks) and something to kill him (let's say Hydralisks, two units I didn't recommend). You would then engage with your Ultra heavy force, backed by long range Hydra. The Marines will naturally target the Ultra who have high HP and Armor, while the Hydra do the lion's share of the damage. When designing an anti-Marine strategy keep this in mind.
I used to include an explanation of Arcs here, but I've since moved it
So you've talked about two completely different strategies which are handled at completely different times in completely different ways. I've gotten tired of trying to explain to people when they have different concepts or the same concept so I'm just going to give you two answers right here.
Bunker Rush
I had the pleasure of watching Fruitdealer vs Boxer at Blizzcon 2010 and one of my favorite parts was game 2 when Boxer Bunker rushed Fruidealer at the start of the match. To his credit Fruitdealer recovered quickly and went on to win that game, but it illustrates what the goal and the strengths are of a bunker rush and how you have to respond
The Goal of a bunker rush is to punish a fast expanding Zerg. Like any other rush it makes a large economic sacrifice to try to devastate the opponent's economy by a larger amount. Unlike 7 Pool play, a Bunker Rush isn't designed to end the match, but rather deny the Zerg an early expansion. By denying that expansion and then going on to expand quickly the Terran player can put himself in a dominant position. Usually this is a debt that cannot be recovered from.
Also unlike a 7 Pool a bunker rush isn't an All-in. Instead, the Terran player usually only makes a handful of Marines and attempts to salvage his bunkers after he has denied the early expansion. This allows the Terran to quickly recoupe his expenses and expand.
Because it is a low cost Rush it is a favorite tactic on small maps by many high level Terran players.
Dealing with a Bunker rush usually means two things: protecting your expansion, and not building too many Zerglings. If you over commit to Zerglings, even if the Terran doesn't kill a single Drone he has denied you a large number of Drones because those Zerglings could have been Drones. At the same time if you don't build enough Zerglings he'll easily destroy your expansion and leave you at an economic loss.
Responding usually means trying to destroy the bunkers before they are built. Pull 2-5 Drones off the line and try to attack the building SCVs. Because double Bunker rush makes an air tight wall this can mean you don't kill the SCVs before the bunker is built. Additionally, you'll need an earlier Spawning Pool than you expected, so as soon as you see the bunkers go down, build that Spawning Pool. If you have a Drone at the expansion its a good idea to get a Spine Crawler up to prevent it from being taken down.
Ultimately, if you can't defend that expansion you need to let it go and build sufficient forces to break out. This is a large set back, but not so large that you can't recover from it.
Marine Congo Line
An early Marine Rush is very different from a bunker rush as it is designed to be All-in play to end the game early. Instead of denying your expansion and trying to out Macro you, the Terran player is trying to force the issue early. Usually this will mean 2-3 Barracks (without any add-ons) and rallying his forces directly to your ramp.
The Marine is one of the most powerful units in the game. Like the Zerglings (and to a lesser extent the Zealot) the Marine represents very cost effective dps. Unlike the Zergling and Zealot, Marines use range to further take advantage of their cost effectiveness. This is often times why people say that the Marine is one of the few units that gets better as the game progresses. As a result, when dealing with the Marine you want to make sure you have a large enough force of Drones+Zerglings before you engage. By sending your units in wave the compounded damage provided by the Marine's range is going to punish you much more than if you were fighting Zealots.
To respond to these Marine Congo Lines, you're going to have to produce a large number of Zerglings and get a good surround. Wait to engage your opponent until the last possible second. The longer you wait the more units and resources you have, so don't engage until you have to. Preferably you'll want to engage on creep and move to surround instead of a-moving. This should trap the Marines and allow you to kill them off. If you're short on Zerglings, do not hesitate to include Drones. They do a fair amount of damage, and this is very much an all-in rush.
Why You're Still Losing
There is a reason you don't see strategies like these at the Bronze level, or even Platinum. These strategies trade very heavily on out playing your opponent by having better execution. Ever notice how Idra sends his drone to build a Spawning Pool before he has 200 minerals? Or how Fruitdealer seems to be able to produce 20 Zerglings at the last second? These players have honed their strategies and removed all the gaps in their build. This skill is often called "Execution," because it is the ability to execute your strategy flawlessly. It usually means little things like: Getting a good Split at the beginning; rallying new drones to under saturated mineral patches; sending out a Drone to build before you have the money for that building; never having 3 Larva at once; having the economy to throw together large forces on the fly. All these things are what constitutes having good execution.
There is a reason Day9 says
I could go just about any strategy and get into Diamond just because I have good execution.
Marine and Bunker Rushes trade on having these very tight, very optimized, builds against an opponent who doesn't, and executing perfectly. Until your execution is on par you are going to get punished by these builds.
Best Answer
The answer to this in early game is generally the standard 3-4 queen opening, a large number of Zerglings, and maybe a few Banelings or Roaches, if you'd like. Banelings and Roaches are usually not necessary with good Zergling and Overlord control.
When scouting, you're looking for an early gas- one started before the natural CC. If you see this, you can generally assume there will be pressure on your expansion of some sort, whether it's Reapers, Hellions, Banshees, Bio, or drop play. Focus on your creep spread and injects early on and by the time this attack hits you shouldn't have too much trouble fending it off just with basic units. Use your Queens to target down Medivacs and Banshees, and just chase Medivacs around with around 12-15 Zerglings each. He won't be able to unload and do damage if you're right on top of him. You're just stalling here, because you're a base up and gaining economically every minute he doesn't hurt you. Good Overlord positioning and map awareness can make it much easier to notice the incoming fliers preemptively- before they have a chance to start dealing damage. If you're finding that the drops are already fully unloaded before you can react to them, that's definitely what you need to focus on improving.
The only need you should have for static defense this early in the game is a Spine Crawler or two at your natural choke if you haven't been able to figure out what kind of attack is coming or for Hellion run-bys, or Spore Crawlers for cloaked Banshees. Good Zergling scouting just outside of your opponents natural should give you ample time to set up defenses if you see an incoming attack that warrants them.