Cranberry juice works in the EARLY (!!!) stages of an infection. After you've had a few, you get to recognise the signs and can start drinking it before it gets to the point where you have to have antibiotics. As Lotus_Blossom says, use PURE cranberry juice (no sugar added). Use a couple of teaspoons diluted in a glass of water. If I dilute it enough I can drink it without sugar, but a teaspoon of sugar or honey is WAY less than you get when you buy that sugared fruit juice (which is only a small portion of real juice). Drink this several times a day for a few days.
Also, as Titchou says, urinate before and immediately after sex. And then drink another glass of water.
And if you need to take antibiotics, make sure you take ALL the prescribed dosage -- don't stop as soon as the symptoms go away. It takes a while for the medicine to kill ALL the little bugs, and if you stop too early, you'll be leaving behind the ones that didn't get killed right away -- that is, the stronger bugs -- which will then be that much harder to kill the next time they congregate in large enough numbers to cause problems.