Cranberry juice, make sure it doesn't have any added sugars or high fructose corn syrup. Also lots of water. I can usually feel a UTI when in it's infant stages by either sight or smell - sorry if this is TMI - but ... if my urine is bright yellow or orange, or if it has a strong odor - I know a UTI is starting and I hit the cran juice and water pronto.
If you are already suffering any pain, or have a problem urinating (feels you have to but not much happens), then you should see a doc for meds.