One of the best books on this subject is "How The Mighty Fall" by Jim Collins. As Collins notes:
Decline can be avoided.
Decline can be detected.
Decline can be reversed.
He also points out that "Great companies can stumble, badly and recover."
One of the key parts of Collins' book is outline the Five Stages of Decline: