I know many 50+ programmers who are doing quite well (monetarily, respect, responsibility, balance). Some independent consultants, some at startups, some with big firms, etc. A fairly wide variety. Not all had to go to management - in fact, I'd say most of the ones I know didn't.
The one trend I've seen is that older engineers that ended up staying with a single employer for the longest (say 10+ years in one job) generally have the most difficulty finding new work when the time comes.
There could be a few explanations for this. One could simply be that people who work for one company for a long time may have a smaller network. That could make job hunting more difficult. Another could be the whole "ten years of experience or one year ten times" cliche.
I do believe there is often some bias against candidates who had extraordinarily long tenures at one company, which may be associated with the thought that these candidates may either be too comfortable at their current job (not need to learn) or so ingrained in a particular work culture that other companies fear that they will not be able to adapt.