I am a programmer who has 7-8 years experience and I work in a small (and growing) company, we have hired 5 people till now. Thanks to our hireing process, they are really brilliant, do things really quick, have a decent problem solving approach and have a steep learning curve. 

I have been with this company for about 3 years now, and when I joined, there was one other guy who left a year later. 

Now with the team growing you have to assign tasks to others, do a breakdown, teach them how to do things and all. And while they do it, they outshine you and in some aspects they can be better than you as well.

So this thing would happen to every senior, I have seen no less than 3 situations where the managers are sitting and doing nothing, are just useless to the company, but then:-

1. Either the company is so big that it doesn't care.
2. They don't pass their knowledge down to their subordinates.
3. They pose their juniors work as done by them.

None of the above applies in my case. 

What I can think of:-

1. Look for new dimensions/technologies of work and bring it to your boss.
2. Move towards management, team building, soft skills development.
3. Do some certifications, training.
4. Look for another job.
5. Start my own company.

The problems with the above is that:-

1. I think you cannot be a jack of all trades if you have excelled in
asp.net you cannot just shift over and be an equal expert in mobile
apps development for example (All the while we have been taught that
a programmer knows no language barriers, which I think is not true,
you need some experience of that particular paradigm to be an
expert, or to do things professionally).
2. Moving towards management is something I can do, at least my boss thinks like that, but I love to be a programmer, for:-

a. You can better guide your subordinates if you have really been there and
 done that. 
b. For better work estimates on new technologies.
3. So i can do certifications but for how long? there will be a limit to the certifications you can do, plus what if your juniors do the same as well?
4. After a span of 3 to 4 years the next job will have the same situation plus I don't want to go through the same process of the transaction from Junior to senior, which is inevitable in the new job as well.
5. This is the only thing in which you are not rendered as someone of any less worth, even if you don't do anything.

So the question:-

**What should a senior person do, if he could do anything, to avoid being someone of any less worth or to be as fruitful to the company as he was when he joined.**

The only answer which I can think of is that this is what happens in the circle of life, people come and go, they get replaced by more energetic, enthusiastic and young people, so I have to live with it. The real losers are those who don't realize this fact and sit in the way of the ones who really deserve the position.