What is the difference between the counseling psychologist & rehabilitation psychologist?

I want to understand this difference, especially in the context of hospital setting for example for patients suffering from terminal diseases like cancer or paralysis?