The Hex spell increases the damage when you hit with an attack and Eldritch Blast is a spell which causes you to make a spell attack roll. Does any attack roll trigger the extra damage of Hex, or only attacks generated by the attack action?
On page 193 the PHB states:
Making an Attack
Whether you're striking with a melee weapon, firing a weapon at range, or making an attack roll as part of a spell, an attack has a simple structure.
And on page 194 it states:
If there's ever any question about whether something you're doing counts as an attack, the rule is simple: if you're making an attack roll, you're making an attack.
So Hex would definitely be applied to each of the the beams created by Eldritch Blast or Scorching Ray, since each individual beam has an attack roll.
In the case of Magic Missile the book seems pretty clear that if you're not rolling you're not attacking, and I'd say Hex doesn't apply.
Wording of Hex (PHB251): "You deal an extra 1d6 necrotic damage to the target whenever you hit it with an attack"
Given that Hex merely refers to 'attack' and not: melee weapon attack, or, ranged attack, and how explicit the PHB is when requiring said attack types, I'm inclined to say that Eldritch Blast triggers the Hex damage.
Side note, it also might be important to point out that Hex does NOT say: "whenever you damage the target". If it did, Hexing a target then hitting it with Magic Missile (one attack, but three damaging darts) would be a cheap way to deal damage.