Let us use corruption as an example. The benefit? A huge amount of money to be used by yourself and maybe your family. The costs? Going to prison and/or losing your corruption assets. Then do a simple calculation on the probability of you getting caught by the authority and how severe the punishment will be. If you think that the probability of enforcement is low and that you can buy your freedom later on, then the benefits of corruption outweigh the costs. The result? People will have strong incentives to corrupt.
The same analysis goes with rape. Why do men rape? Is it because the urge of their hormones? Because they can't withstand the sexiness of a hot girl in front of them and thus they must channel their sexual needs by raping such girl? Well, those might be added to the equation, say the benefits of rape. But there are more important factors and those are timing and situation for the rape itself. A rational human being, even the stupidest one will never conduct a disgusting activity such as rape at the middle of the day in front of many people. The costs will be too big to bear by any rapist existing in this world. And there would be other ways that are far cheaper and less risky to channel your sexual needs in the above case, such as masturbation or even looking out for a prostitute (yes there are other costs associated with having sexual activities with a prostitute, but we can safely assume that the costs should be lower than raping a woman in front of the public).
Going back to timing and situation. Why do I say that these are the main factors in determining whether a rapist will conduct his evil deed? Timing and situation affect greatly the success rate of a rape! And each rapist who have minimum thinking capacity knows that if he has a good chance to rape someone and a small chance of getting caught, the benefits of the rape outweigh the costs. You know the rest of the story. Furthermore, I would assume that in the mind of the rational rapist, whether the victim wears a mini skirt or a long dress is simply a small factor in the equation. In the end, a rapist will do something to let the victim out of her dress, longer dress takes longer time, but that's it. If the timing and situation do not permit, I dare to say that no one will rape even an almost naked woman.
Even worse, rape is not a criminal activity that can be easily proofed in the court. Usually the crime is conducted behind the scene and the longer the crime is reported to the authorities the harder it would be to find any supporting evidence for bringing the rapist to justice. All of these facts minimize the cost of rape crimes! The fact that the public normally blame the victim does not help at all. To certain extent, it induces the authorities to think that the victims have a role in the crime and you may say this is as a baseless claim, but I would assume that such kind of thinking will slow them down in doing their job. Imagine this: a friend comes to you saying that he lost his wallet because he put it carelessly in a public park. Would you quickly help him, or will you say: "dude, that's stupid and is your own fault, and now you ask me to help you?".
Will all of the above things, how can we effectively prevent rape crimes? By not working together in creating a safer environment and instead blaming the victim, the general public are actually responsible for supporting the crime itself! Honestly, I don't even want to be a part of it. Would you want to be a part of such bad act? I hope not.
Note: For follow up readings on the economic analysis of criminal activities, I would suggest you to read the articles of Gary Becker (Crime and Punishment: An Economic Approach and The Economic Approach to Human Behavior can be a good start), a Nobel laureate from the University of Chicago. He writes a lot and has a very nice blog with Judge Richard Posner here.