How does one evaluate a "locomotive" (rainbow card) in "Ticket to Ride?"
Here are three sources of pain you try to avoid:


Drawing only one resource card instead of two
Drawing resource cards that you will never be able to spend
Losing a race to build a link you want (an opponent gets there first, or the game ends first)


The single rainbow option is the only way to get stuck drawing one card instead of two, but rainbows are always spendable and awesome for winning races. I like to keep one or two on hand in case I find myself in a surprise race with an opponent, so after the first few turns I'll take one whenever I don't have one. I usually try not to spend them on very long links unless I think I'm in a race for those links - instead I'll just take known cards of that color when possible, and unless an opponent tips their hand by also taking known cards of that color, it's unlikely they can collect the requisite number before I do. (In contrast, for a short link it is likely they've randomly picked up one or two cards of that color.) I'll also start taking single rainbows more often at the end of the game since they're guaranteed to be usable.

Early game, I usually draw random cards - the main thing I'm risking is losing a race with an opponent, but on a wide open board it's often both unlikely that an opponent takes exactly the link I want and not too terrible even if they do since I can reroute around them. Draw randoms enough and you'll even end up with a rainbow or two to fall back on in hard times, and there are enough links of every color (and gray links) that you'll probably eventually find a use for whatever you draw. However, random cards get less and less attractive as the game progresses - with fewer links left there's more of a chance that an opponent wants the same one as you, or that you'll draw cards that you never find a use for.

When the known cards include colors you need, taking them is always an attractive option. An obvious downside is that you lose the ~1/9 chance of landing a random rainbow; a less obvious but potentially larger downside is that you give your opponents a hint about what you're planning to build. If you don't think your opponents will effectively use that against you - they can't figure out what you're doing, they don't have the resources to stop you or it's not sufficiently in their advantage to use them, they're not that kind of competitive, etc. - then taking known useful cards is usually the best choice. But occasionally you take that red card and then an opponent jumps on the opportunity to build the red link you wanted; not only is your link now gone but the red card is now probably less useful than a random one.