The rules for damage rolls say:
If a spell or other effect deals damage to more than one target at the same time, roll the damage once for all of them.
So for the spell magic missile, it seems quite clear that you only roll the damage once. Magic missile says:
The darts all strike simultaneously.
So you roll the damage once for all the missiles, rather than rolling the damage once for each missile.
Notably, magic missile does not require any attack rolls - the missiles just hit. Additionally, magic missile explicitly states that the missiles hit at the same time.
These two facts make magic missile seem quite different from scorching ray. Scorching ray calls for an attack for each ray and does not have a statement concerning the simultaneity of each hit:
You create three rays of fire and hurl them at targets within range. You can hurl them at one target or several.
Make a ranged spell attack for each ray. On a hit, the target takes 2d6 fire damage.
Further, the rules for attack rolls seem to suggest that when you make an attack roll, you roll damage for that roll. From the rules for making an attack:
You make the attack roll. On a hit, you roll damage, unless the particular attack has rules that specify otherwise.
How many times do you roll damage for scorching ray - once for each individual hit, or once for all the hits?
Note, this situation is different from the one described in this question: How many damage rolls do you make for the Prismatic Spray spell? Prismatic spray uses saving throws, not attack rolls.