1. Drones
Drones now require a threshold of 5 to affect in SR4A. That requires, on average 15 dice on your spellcasting roll, and the use of Physical spells. It is still quite doable for a starting mage, but it is not a gimme, and requires some specialization on the mage's part, to the detriment of other areas of expertise. Railguns, Steel Lynxes, and embedded turrets make formidable opponents for a mage, and importantly from the corporation's perspective, they are cheap. They can spend the minimal upfront costs to acquire technological defenses, and then either contract out to a security firm to have a Spider on standby, ready to jump in should an alert be sounded, or important facilities can have their own dedicated Spider.
2. Tactics
It's been said many a time, minimal tactics can negate a mages ability to screw you by limiting LOS. There are a lot of options here, limited only by your creativity: Have them take cover, fire smoke grenades to limit visibility, have one member of the response team engage in suppressive fire while the other members attempt to flank the team. Thermal smoke + suppressive fire usually will keep a mage from doing anything resembling an "I Win!" button. Tying in with drones, an automated drone may have a crap dice pool, but suppressive fire will still keep the mage from popping his head out - many mages have poor Edge attributes due to the demands of their build, so suppressive fire is an excellent method of keeping them in their place. And of course, never forget grenades - gas grenades in particular can be effective, as they linger. Also, having guards in personal mobility vehicles with tinted windows and a weapon mount becomes a fairly simple and effective "F U" to a mage with only mana based spells, as it completely removes LOS. Finally, one way glass is cheap, and again, effective.
3. Manatech
Street Magic and Arsenal features ways for mundanes to prevent being ambushed from the astral. Awakened Ivy, Haven Lilys, Guardian Vines, and FAB aerosol sprays can prevent a mage from Astrally Projecting into a middle of a group of guards - the better to keep them from dropping a summoned spirit on them while staying safe in the Astral. Biofiber can be used for a cheap Ward - the initial upfront costs can be expensive, but long term maintenance is cheaper than constantly contracting out with a magical security firm to continually renew a ward. Additionally, facilities can be built underground to protect against astral intrusion - the earth acts as a barrier to Astral forms.
4. Magic Security Firms
Magic counters magic, but you don't need a wagemage sitting around every facility waiting for that rare enemy mage to show up and make his life interesting. Magical security can be contracted out on a sliding scale: for a minimum rate you can have your facility warded for a few weeks. Next, we can have the off-site security mage loan a service from his bound spirit to the captain of the security team upon receiving an alarm call: remember also, that certain spirits from Street Magic have Magical Guard, which gives them the ability to provide counterspelling to a team, in addition to a spirits other powers. Moving up, we can secure a mage who will show up to the area in the astral when the alarm is sounded, manifest, and use his counterspelling ability on corporate security (with his own spiritual back up to protect him should the runners try to take the mage out in astral combat). On the next step up in the pricing scale, the contract Mage can show up astrally as above, but actually order his spirit(s) into combat.
5. Dedicated Facility Mages
Finally, we can have the dedicated facility mage for those really secure locations - this state seems to be the only method some posters believe is effective in countering magical aggression. Even then, a security mage doesn't have to be super good to be effective in limiting enemy mages. A mage focused on defense is going to specialize in different areas than a runner mage: Counterspelling, banishing, bound spiritual back up, and "boosts" to his security team are more effective uses of a rare and expensive asset than having him sit in a corridor, slinging spells, and potentially getting shot. A dedicated Counterspeller can really put the kibosh on a lot of things: Counterspelling 6 + Combat Specialization 2 + Mentor Spirit 2 + Counterspelling Foci (combat) 3 = 13 dice added to willpower scores for combat spells, or 8 for other types. The nice thing about a dedicated counterspeller is that even the crappiest, barely magical of mages (or mystic adepts) can be a ferocious magical defender, as counterspelling does not utilize the magic attribute. This makes the dedicated counterspeller relatively cheaper, more available, and still effective addition to a security team than the Super-Mage with Mighty Spirits that many GMs likely default to in order to challenge their players.
As you can see, there are a lot of ways the a facility can cheaply and realistically protect themselves from being ganked by a runner team, without having to pull out an equally powerful mage every other run just to keep your player's magical assets challenged. Comments? Tips? "You suck and your suggestions will never work!" advice? I welcome them all.

Edit: Incorporated HappyDaze's suggestion to number 4 (loaned services), because it was good.

Edit 2: Added Jaid's suggestion re: PMV's and LOS to number 2. Added W@gemage's point about one way glass to number 2.