I have hurt my brain thinking about this. Mass Effect, like a lot of Sci Fi, has anti-space weaponry on planets that can be used against enemy starships. They've always been a part of the series; the merc on Korlus mentions them, the AA guns on Virmire were implied to be able to hit the Normandy in orbit, the codex entry on space combat mentions them, we see them on Tuchanka, Palaven, and Rannoch in 3, one is referenced as having taken down Koris's ship, et cetera. My question is, how are they supposed to be effective?
Think about it. According to the codex, the effective ranges of mass accelerator weapons are only limited by the speed and maneuverability of their opponents. "Beyond a certain range, a small ship's ability to dodge trumps a larger attacker's projectile speed." With that in mind, why would stationary, completely immobile ground based defenses be useful at all? They can't move, so the ships could simply park a million kilometers away and shoot them. The planetary defense cannons (let's just start calling them PDCs) could fire back, but their projectiles would take several minutes to hit their targets. During the time that those projectiles are travelling, the target would've already moved out of the way a long time ago.
"But they're not meant to defend a planet alone", you might say. "They're meant to support a defending fleet". My response to that is: why couldn't the attacking fleet simply destroy all the guns before the real battle even began? There's nothing the defenders could really do to stop them.
On that same token, what was with Horizon's defenses? They're lasers they have an effective range of a few dozen kilometers. If pirates wanted to attack, what's preventing them from simply destroying the guns in the same way?