My advice would be not to go into management unless there is a way to keep your technical skills up. You won't find the headhunters as eager to place managers, except the highly technically adept ones. If you let your technical skills rot, it may become more difficult to stay employed.
I've worked as a developer, architect, project leader and "director of development" (whoa) and I prefer the technical contributor roles -- but that's just me.
As far as the companies that appear to be "age-ist" -- run away! A lot of that is done because the younger developers can be had for less money, they can and will work longer hours (usually because they don't have a family or really any life outside work) and they just don't know better. I can tell you from the times I have done "leadership" that I would rather have two skilled old-timers than four fresh-outs working on my team. The two old timers will almost always out-produce the four fresh-uts in terms of actual delivery and quality. So you get what you pay for.