PHB. Pg 204: "To target something, you must have a clear path to it, so it can’t be behind total cover."
You don't need need to see a target in order to target it. Only hear it. If you can't see or hear it, you need to guess where it is.
See "Unseen attackers and targets" page 194, which I quoted earlier.
An NPC attacker with a bow up in a tree.
PCs cast Fog Cloud.
Since they knew where the NPC was before Fog Cloud was cast, are they guessing when they can no longer see the terrain around them? Can they just fire their bows with disadvantage and automatically not guess where he is?
This actually came up in our game. It seems a bit much that someone could target the exact square that a foe is in, even though they cannot see that square (in our game, hex). Our DM actually came up with a house rule for it later on.