
Marines are very weak in the beginning of the game. Having only 40 HP, they can't match with the zealot, or the dual attack of zerglings. They do possess the earliest range attack in the game, and at a cheap cost of 50 minerals. Marines can be created very fast, so making supply depots early should be done.
First off the bunker is the only way to make a defending group of marines more effective. It's actually adding 100 HP to each marine. Which makes them almost equal with zealots. Also hiding behind structures, can be done, since the marines have a good range attack and fire rate.
The first upgrade that you should get is from the academy, namely stim pack. This will double the rate of fire of the marines at a cost of 10 HP. This is especially useful for dealing an insane amount of damage in a short time. Try combining this with medics to negate the 10 HP cost. Stim pack also allows marines to move faster, which will make them very effective before you attack, because they can get into position and start attacking before the enemies units do.
The next upgrade is the range upgrade. This will make your marines get extra hits, and help on defense because the back row of marines can now attack units. Both of these upgrades can be researched very fast. Other upgrades are the engineering bay. The attack and defense upgrade will make the marines more effective, yet they do take a long time to research. The armor upgrade should be researched first, because range units will benefit the most, because they can survive extra hits.
The marines are one of the best anit-air units in the game, especially against mutalisks. This is because they deal normal damage, which allows them to be effective against most units that don't have a lot of HP.Dropships also are great to combine with marines, because eight marines can loaded on and unloaded off a dropship.