I did the programmer/manager/director thing ending about 10 years ago when I was in my early forties. Since then, I've been doing the consulting thing, mostly strategic and management consulting into large companies. I'll say one thing: It pays very, very well and if you know how to handle an interviewer, you'll rarely be out of a job.
The hardest thing back in the day was to give up on the hands-on work. It's what I knew, I was very good and passionate about it. That said, kids today ( I mean kids under 30 ) have their own mind set and find it hard to relate to older people in the work place. Bottom line, I prefer working with my peers and by the time I hit 40 I noticed I wasn't really interested in what the kids were doing. So I moved on.
I have never encountered age discrimination because I've always focused on (difficult) work that requires lots of experience and made sure that the interviewer got the sense of my laser-like focus on the statement of work and providing value to the customer.
Every company worth a damn needs an old man. I just hope I'm not too old before I decide to pack away my FORTRAN user guide for good.