A PID is a UFD, but the converse requires more info. See (for example)
ftp://ftp.cis.upenn.edu/pub/papers/gallier/geomath3.pdf Proposition 5.40
All is not lost, I think. Here is a suggestion: Suppose a and b have common factor k: a=k*a1, b=k*b1. Then (I believe, and invite verification) the intersection of (a) and (b) is (k*a1*b1)=(c). This may require the ideal to be two sided.
Hope this helps....