You don't have to be the best programmer to be promoted to become a manager of programmers. Though knowledge of programming is good, management is an entirely different ball game altogether.
It's like this. A lot of good football managers were football players, but they weren't the best. Jose Mourinho, case in point. He wasn't a good player at all. But his dad was a good manager.
In fact, being a good player doesn't make you a good manager. Most of the world-cup winning squad of 1966 didn't do too well in other jobs.
My advice to people who want to go up is that you don't need to be very good in the lower level tasks to go into management. Get an MBA or a certified project manager and find people who will hire you into management. You can't wait for your boss to promote you to a position. People skills are a much different skill that accounting or programming, etc.
80% of the success of your career is in your hands. Not your boss.