Jackson Galaxy has covered this one a few times
1. Try taking the cover off the box, if you are using a covered tray.
2. Take your cat to the vet to be checked for arthritis, injuries, or even a uti that might be causing pain. If the sides of the box are high, it could be a struggle for an elderly cat.
3. Make sure the box is super clean. Buy more than one litterbox if you have multiple cats.
4. Is your cat stressed about anything? Make sure she has a quiet place to retreat to when she wants, where she won't be disturbed by other pets or children. Don't let other pets or children harass your cat. Make sure your cat is getting adequate playtime if he/she is not allowed outdoords.