I've played a total of 3 games online. PvT, PvT and ZvT.
Lost to marines and medivacs, every single time.
a LOT of people use the MMM tactic, and it is fairly unstoppable... if you let it get big enough. you need to be reguarly scouting your enemey to see what they are doing, and stopping them from getting such a good army. try attacking early because to get medivacs (and usually marauders are there too) they need to convert a fair bit of their SCV's into producing gas of tech upgrades, etc. therefore the will have less minerals early on and in theory you should have more men.
if they do manage to get a bit MMM ball then dont meet it head on unless you have a much bigger army. try holding your base against them whilst sneaking units round the back to take out their supplies. tanks in siege mode work well, or colossus' work wonders against marrines (especially if you upgrade their range), and to attack their supplies you can use reapers, banshees (good because of their cloak ability), or any other unit you can get behind their main line of defence before they can stop you. with this done you can slowly pick off the MMM's and they wont be able to build anymore.
if you are playing as zerg you can always try using burrow (especially with roaches as they heal very quickly when burrowed). wait untill the MMM ball is right above your burrowed roaches the raise them, wreak havoc for a few seconds, then burrow again. though beware of the terran using scan on your burrowed units because then he will be able to attack them anyway.
these are just a few suggestions, and none of them in any real detail. there are a lot of different strategies and counter-strategies in starcraft, and i dont pretend to be a real expert, but think about what units are good against what and try it out. (can be especially helpfull if you have someone willing to let you try stuff out with them in custom games.
if anyone fancies a game or something feel free to add me online, my nick is tomtree.