*Referring to the passage about lust and adultery, not specifically rape.*
The churches I've attended have always taught that thought=action to God, so that's what I was brought up with.
That is not true. Thoughts and imaginations can enter the mind at any time, but that does not mean that we have to entertain them. God gives us the ability through grace to cast these imaginations down that exalt themselves against the knowledge of God (2Cor 10:5). If we entertain them mentally, it won't be long before they enter into our emotions and turn into desires of the flesh and mind (Eph 2:3) to be executed by our human volition as the motions of sin (Rom 7:5). When we are drawn away into some form of lust that gets conceived, it brings forth sin and when the sin is finished it brings forth death (James 1:14,15). When those thoughts come against the knowledge of God you immediately define them and put them down. Any thought or imagination outside of God does not have to define who we are in Christ. To have the imagination or thought is not sin and does not have to identify us. Believers do not have to go around confessing every bad or wicked thought they have as sin. The thought is sin and it does come from a wicked heart, but all we have to do is acknowledge where comes from, receive grace and don't give it a place in our life. This is the law of the Spirit of life that makes us free from the law of sin and death (Rom 8:2).