One of the most discouraging and heart-wrenching things for a believer to experience is the presence of evil thoughts towards God in his mind. Often demonically-induced, these thoughts can drive a Christian to despair, as he is fooled into believing that the thoughts are originating from himself, and not the enemy.
If you are in the midst of this trial, I want to recommend the following two resources to help you begin to navigate these deep waters. May they help you to fight the battle, as you seek to take every thought captive to the obedience of Christ (2 Cor. 10:5), and be transformed by the renewing of your mind (Rom. 12:1-2).
Evil Thoughts - John Newton
Thoughts on Religious Experience (Chapter 11) - Archibald Alexander