Martyn Lloyd-Jones addresses this issue in his book Spiritual Depression: It's Causes and Cure. I was helped by the chapter on the parable of the laborers in the vineyard (Matt. 20).
The first laborers in the vineyard bargain with the master for their payment, but later when they receive their payment in full, they feel that the master has treated them unjustly because others were rewarded in a greater way then they were.
According to Lloyd-Jones the cure for this type of depression is realizing that things work differently in the New Creation. (2 Cor. 5:17) If we are in Christ, we can no longer act as if the old rules of this world apply.
We must say to ourselves every day of our lives: 'Now I am a Christian, and because I am a Christian I am in the Kingdom of God and all my thinking has got to be different. Everything here is different. I must not bring with me those old ideas, those old moods and concepts of thought.' (p.129)
So how do things work in the Kingdom of God? First of all, says Lloyd-Jones,
Do not think in terms of bargains or rights in the Kingdom of God. That is absolutely fatal. There is nothing so wrong as the spirit which argues that because I do this, or because I have done that, I have a right to expect something else in return. (p. 129)
It doesn't matter how spiritual our actions are. We cannot strong arm God into doing what we want. Even if we stay up all night praying for revival, we cannot make one happen. Only God can bring revival. If we are faithful in our spiritual disciplines, we do not have a right to joy and contentment. If we do good to others, we do not deserve to have a beautiful life.
The key according to Lloyd-Jones is realizing that "Everything is of grace in the Christian life from the very beginning to the very end." (p. 130) Not only that, but you are actually robbing yourself if you try to bargain with God. It is never a good idea to do something for God so that He will do something for you. "If you do, you will get only your bargain; but if you leave it to his grace, you will probably get more than you ever thought of." (p.130) (cf. Matt. 6)
I especially loved his next new creation principle:
Do not keep a record or an account of your work...keep your eye on Him and His glory, on His love and His honour and the extension of His Kingdom.
Lloyd-Jones points us to Matt. 6, "do not let your left hand know what your right hand is doing,...And your Father who sees in secret will reward you."
There is no need to waste time keeping the accounts, He is keeping them. And what wonderful accounts they are. May I say it with reverence, there is nothing I know of that is so romantic as God's method of accountancy. Be prepared for surprises in this kingdom. You never know what is going to happen. The last shall be first. What a complete reversal of our materialistic outlook, the last first, the first last, everything upside down. The whole world is turned upside down by grace...His book-keeping is the most romantic thing I know of in the whole world.I am beginning to realize that it is all of grace in the Christian life--not just my entry into it--but also the middle and the end. And this realization brings a delightful joy and contentment.