What's the best counter for Void Rays?
You're falling into the trap of "What would be good right now." This is a mistake when evaluating strategy. Any choice at this stage will necessarily be too late as it requires a time and resource investment that can't be made instantly. Instead I would suggest the following:
Void Rays take a long time to build and represent a substantial Vespene investment. This should allow you to produce as substantially larger army against a Protoss player focusing solely on Void Rays. A small investment in defensive structures will keep off a small force of Void Rays, however any larger force of Void Rays is better handled by direct assault on the Protoss base as you can produce a more cost effective force.
Bear in mind that a Protoss player investing in a gas heavy strategy (like Void Rays) will have an excess of minerals. The result is that their defensive force will largely be made of Zealots. Take this into account. Additionally, they are also very likely to expand as expansions are made out of minerals and provide excess gas very quickly.
Finally, I recommend better scouting. Seeing an early second Assimilator is a tell-tale sign of a Void Ray rush.
A word to Protoss players: A Void Ray rush is not a sustainable strategy, neither are mass Void Rays before you have a Mothership out. However, Void Rays do complement a Tier 1/1.5 force very nicely, especially armored units with High HP.
Void rays are easy if you have sufficient ground anti-air.
Protoss
Stalkers, especially with blink. Do not make phoenixes-- they are not good against voids.
Terran
Marines. Early on marines can handle any void rays you come across. Later, vikings will make mince meat of them.
Zerg
This one is a little harder. Early on, if you scout that they are making voids making queens. Use the heal ability if you have the energy.
Spores work, but are not the best since they can't move well and have pretty short range. Tech to hydras as soon as possible. Infestor's fungal growth is pretty great esp. with hydras.
Void Rays are becoming an increasing problem for me as well. In 2v2 and higher games it is hard to account for them completely because even if you are ready for them the teammate you are with may not be. If you see the one void ray camped out when you scout and believe he intends to make more the best answer is to gather what force you have...(hopefully enough anti air to take out the ONE void ray.) and wreck his pylons. Most likely he is going to need a ton of space for a ton of voids and this will delay him enough to make the few voids he does push out futile. Killing pylons isn't very difficult either and can be done with any hard hitting fast unit so you can raid as you would against drones SVC's and probes. Reapers, Dark Templars, and even Muta's are good at the hit and run on pylons. Most of the time if you have a fear that he wants to mass void rays you have reason to believe so... meaning you have enough time to react. Reacting and properly taking away his strategy (when it comes to void rays because they are very hard to just switch to another strategy after you have geared up for them) is almost a certain win. BUT...
To further answer your questions DIRECTLY I have found that only one unit really does well against massed voids... massed marines. They are cheap and small enough that a void ray focus on a marine takes just enough time that your mass of marines can pick a few off.
To further lend some advice... If they are getting void rays on you, you and your teammate need to attack faster in every game. There is no circumstance that an enemy should have the resources and time to gather that many voids.
To be COMPLETELY honest.. there is little to no good way to defend against massed voids if they are already built. Your most likely behind already.