An opponents switch to air in the mid game can be an annoying this to deal with. Luckily, Zerg air can counter Terran air quite effectively.
First, before deciding to raise a Zerg air force, you must first make sure you have a minimum of 2 bases, with all 4 gases being mined. without this, your income will be insufficient to support your air army.
If your opponent decides to go all viking, there is a simple way of countering. Build up your anti air defenses, and keep a group of mutalisks out of sight. When he flies his vikings in to attack, he will most likely land them. This is when you swoop in with your mutalisks for the easy kills.
The main threat with these is holding off the early attack on your mineral line. As long as you have enough queens and overseers to hold them off, you should be fine.
Ravens prove to be a little difficult. If you try to attack with mutas, he will use point defense drones. If you attack the drones, he will hit you with hunter seekers. Micro is key when dealing with these. Ravens are usually backed up by a marine ball, so try to split up his forces.
Corrupters do a good job at staving these off. If there is a sizeble amount of BCs in his army, infesters can be vital in cutting their numbers. A counter attack on their base is also an option.