So in a sense, that's inevitable, isn't it?
The alternative would be to ensure that birth rates are such that the population distribution across ages is always vaguely balanced, but due to the changing socioeconomic conditions, I doubt that's viable. So all that can be done for the most part is just to have social safety nets and support for the older people in the forms of affordable housing, discounts, pensions and other such systems.
Here in Latvia a certain part of each salary is put towards our retirement funds, be it through a privately managed set of funds (typically through one of the banks) or otherwise. The sizes of pensions and living expenses are still a hotly debated topic, given that those still aren't always sufficient for a comfortable lifestyle, but the idea of accumulating enough money for when you age seems like a sane approach to the problem at hand.