Emotional voters and the Democratic Primary
Voters presumably vote for the person they find to be most qualified, right!?
Well, maybe not.
Clare Malone, a journalist at fivethirtyeight suggested after Sanders stunned Clinton in Michigan that one of the many factors at play may have been that people who would have voted for Clinton instead voted for Sanders, as they were sure because of polling Clinton would win. I have no idea what kind of scale this occurred on, but it makes sense. Unfortunately for her, she was mercilessly attacked on twitter by the Sanders faithful. But I think this happened on some scale.
Anecdotally, I was inclined to vote for Ron Paul in the Republican primary in 2012 simply because the "Romney as Republican Nominee" Romney wasn't very compelling. And while I'd never vote for Ron Paul if I knew he would win, for a wide variety of reasons it would have felt pretty good to stick it to Romney and vote for a real nice genuine guy with strong principles. I don't doubt that Bernie Sanders is a real nice genuine authentic individual, and he's nothing if not consistent. I also think his call for revolution lets those who support him feel as they are part of something bigger. As a friend put it "why not protest in Berkeley, it's kinda fun." Similarly, Clinton was just attacked for noting that many of the Sanders supporters may support him for reasons along these lines.
I think it's pretty possible that there are crossover voters, voting with their heads for Clinton (boring, pragmatic, likely solid candidate) when she seems in danger, and for Sanders (exciting, calling for revolution, consistent, personable) when a Clinton win seems certain. Sure, this may not be a lot of voters, but I'm sure there are a some that identify along these lines.
Also, as alluded to in the Freakonomics link, some of the reason for voting is peer pressure. And in college, with all the Sanders voters around, I do feel pressure that way. I sure as hell wouldn't want to talk about how I'd vote for Clinton, if I was going to.
Stop Trump? aka Game Theory with imperfect information
On the Republican side we see a different game at play. Many are voting for Trump out of feeling, not thought, but those trying to stop him are trying to coordinate to be able to stop him. Cruz seems to be the annointed one for this task, but Cruz has issues among moderates come the general election. In the Norcal district where I'm registered, I'm not sure whether a Kasich or Cruz vote would be better to stop Trump, but whatever it is, any Republican voters in my district could have real impact. There aren't many of them, and California could be decisive.
Edit (6/24/16): I'm not encouraging this sort of self-maximizing voting in any way. Though I felt like voting for Ron Paul, I didn't, for the reason he wasn't the better candidate, and I don't support his positions. On the aggregate it is awful, and degrades the social contract. In fact, we've seen with Brexit that this sort of "Feel-good voting" can lead to awful outcomes.