There's nothing RAW that indicates that players would know whether or not a creature is affected by most spells, though presumably in the instance of Ray of Sickness, players could infer whether the spell had taken effect based on a creature's behavior.
Does the hobgoblin captain slump for a moment, resting on her spear? Does the shadow demon react at all to the beam? Those are probably telling.
Zone of Truth appears to be a little different since the caster explicitly knows whether the target succeeded or failed the saving throw, which can only occur if the creature is affected by the spell in the first place; a creature which isn't affected by the spell never makes a saving throw. In this way, the caster would know if the hostage weren't affected, if only circumstantially; instead of having succeeded or failed to resist the spell, the Rakshasa would effectively be invisible to the spell, which would surely be suspicious.