Firstly, Protoss will do this A LOT against Randoms because (this sounds silly) Protoss is incredibly broken against Random. Y'know what happens if you don't forge expand on Tal'darim Altar? Y'know what happens if you make your gateway at your ramp against a Terran? Bad things. Bad bad things. So because of this, one opening that has a low, but decent chance to work against every race is the 4gate, especially at your level players don't change their builds from what they scout so if you see one gas and two pylons when you scout you should absolutely assume a 4gate, check the chrono on the nexus as well, it should be high. Then again, low level players don't really spend it anyway.
So you've figured out how to scout it. As Protoss (on maps that aren't Tal'darim Altar), you wanna go 2gas 3gate, get out sentries to forcefield the ramp until you have enough units (typically 1-2 immortals) then you can crush the push. 4gate is pretty much dead PvP because of this, you can forcefield that ramp absolutely forever, and Stalkers do nothing once you hit 2 immortals.
As Terran, the most important thing is bunkers. If you're scared of 4gates, even if you take an early expo if you have well placed bunkers and make sure there's no pylon in your base you should have no problem holding it at all, especially with some marauders. Just pull SCVs to repair and once you have stim/medivacs you can easily kill a Protoss stuck on nothing but gateway units. You can 1rax FE but 2rax is probably safest, you get a reactor on your first rax after your first marine then a tech lab on your 2nd, constant marine/marauder production, get conc shells -> combat shield and once you have the minerals make a CC.
As Zerg, Roaches are a great response but pure Zerglings can hold it off with little issue. 2-3 spines, an extra queen for early transfuse (if you think it's coming, just don't make creep tumors with your creep queen because the game will be over once you hold it off) and it's no problem at all. Make sure you have units AT THE TIMING (5:45, probably later at your level) because Protoss can forcefield the ramp and you can't hold it off on one base. If you know the push is coming, it's not difficult to stop in any matchup. Standard opening, hatch first/14pool/speedling expand, all fine. Obviously you can't do anything on one base.
Also, in every matchup, if you stop the probe from making the proxy pylon...you just delayed the push by a minute and just won the game. He may be able to protect it well, but speedlings/stalkers/whatever being able to catch that probe is game ending.
I don't 4gate randoms but I 4gate PvP on TDA and I 4gate +1 Zergs that I think will die to it. All from experience, I 4gated to gold easily. Hope this helps.
Even the smallest donations help keep sc2sea running! All donations go towards helping our site run including our monthly server hosting fees and sc2sea sponsored community tournaments we host. Find out more here.