If the player that is facing Void Rays is not aware of the incoming threat, he or she might be caught unprepared and thus there will be an opportunity to deal massive amount of damage.
In all these situations, Void Rays can still be used as a threat, forcing the production of anti-air units and keeping the opposing player inside of his or her base. Zerg players can build additional Queens until they are able to morph sufficient numbers of Hydralisks or Mutalisks. Against Terran, sufficient numbers of Marines (especially with Stimpack), or properly controlled Vikings, can deal with Void Rays. Against Protoss, Stalkers can deal with Void Rays easily because of the ease of making large amount of Stalkers, unlike the time required to make Void Rays. Due to their relatively low number of hit points, Void Rays have limited usefulness in the early game if anticipated by the enemy.