The simplest solution to a similar problem (a single hanging word in a headline) that I've seen is to replace the 'space' between the last two works with an This forces the last two words to stay together as a unit. It can be automated with a simple piece of ECMAScript.
It's not the single word alone in a line. It's a final line that significantly shorter than all the others. You want to strive for text that's mostly ██-shaped, not ▐▀-shaped. Replacing the last space by a non-breaking one just shifts the problem around a bit (and you still have occurrences like “I am” at the end of a sentence – it's not like the final word is always something nice and long like “sightseeing”).