A cannon rush is a protoss strategy useable against any race, but most effective against another protoss.
The attacking player either builds early photon cannons outside of the enemy base or secretly builds cannons in the opponent's base early (which usually leaves the attacker open for an attack), just behind the edge of that player's sight radius. If not scouted, this tactic is very frustrating for the less experienced players to deal with.
The best way of countering this rush is to scout. If the player reaches the opponent's base and sees a peculiarly small amount of structures, it's a clear indicator that a cannon rush may happen. If the initial scouting worker fails to find the opponent by about 13-14 food, the player should have another worker make a sweep around the outskirts of their base area, looking for hidden probes, pylons and possibly cannons that are about to begin building. If the player notices any of those, they should send a few workers to hunt down the probe and prevent cannons from going up or at the very least delay their progress towards the player's mineral line (by forcing the probe to make more cannons and pylons in its current position). The player should not overcommit by sending all their workers. Then, depending on what race the player is, one's options are either:
- Planting a defensive cannon somewhere on the way of the enemy cannons or making fast stalkers (use stalkers to snipe any cannons that begin building and stick out, fall back to recharge shields if a stalker gets hit; once you have enough stalkers, go to the enemy base and finish him off),
- Making two spine crawlers away from the enemy cannons and then move them to a position where they can both attack a single cannon at a time,
- Making a fast marauder and plant a bunker on the way of the incoming cannons. A bunkered up marauder stops the cannon rush immediately. Alternatively you can lift off and move to your natural.
Be aware, however, that the opponent who has cannons in your base also has pylons there, so if one doesn't get rid of them in a sensible time frame, one might face protoss gateway units warping into one's base area in a couple of minutes.