For the rest of this article, put the illness of depression aside. What I am talking about here is the 'going inward' of a person who is dying. The person may be depressed as well, or has fought it their whole life, but this process is outside the realm of depression.
What is happening is their focus is now internal. We believe this is the busiest time of life. They are doing what we call 'life review,' and they are preparing for the ultimate journey from their body. It may appear to you they are depressed when they are refusing guests, activities or watching their favorite show. They are not. The closer they are to their death, the more you will notice the withdrawal.
When you see this, know they are working out their lifetime. They are looking back over their life intensely. What this may look like is a strong need to tell you stories and share pictures. You may start hearing about people and incidents that you have never heard before ... and they will be sleeping more.
When you begin to notice this process is happening, what you do to support them now is to sit down and listen. Don't change their story. If they are telling it with the wrong details, etc. let them. The gifts to give right now are time and your listening ear. Priceless.