Q:

Nonfree projective module over a regular UFD?

What is the simplest example of a domain $R$ which is regular (in particular Noetherian) and factorial which admits a finitely generated projective module that is not free?
In fact I'll be at least somewhat happy with any example, since I can't think of one at the moment.
Some brief comments: $R$ needs to have Krull dimension greater than one or else it is a PID.  The module in question needs to have rank greater than one, because the hypotheses force 
the Picard group to be equal to the divisor class group and the divisor class group to be trivial.  And famously, by work of Quillen and Suslin, one cannot take $R$ to be a polynomial ring over a field.  Oh yes, and of course $R$ can't be local (or even semilocal, I suppose).  I'm already out of ideas... 
P.S.: If you can get an easier example by removing the hypothesis of finite generation, I'd be interested in that as well.

A:

Depending on what you consider simple, let $k$ be the complex numbers, or the integers, or the field with two elements (or any other commutative ring you're fond of).  Let $R=k[a,b,c,x,y,z]/(ax+by+cz-1)$.  Map $R^3$ to $R$ by $(f,g,h)\mapsto xf+yg+zh$.  Let $P$ be the kernel of this map.
$P$ is the universal example of a rank 2 projective module over a $k$-algebra that becomes free after adding a free rank-one direct summand.  (That is, if $A$ is any other $k$-algebra with such a projective module $Q$, then there is a map from $R$ to $A$ such that $Q=P\otimes_RA$.)  One could argue that this makes it the simplest example.  In particular, Hugh Thomas's example arises from this example in this way.
To see that $P$ is not free, use the fact that Hugh Thomas's example is not free.  Alternatively, invoke the much more general result of Mohan Kumar and Nori, which says that if $R=k[x_1,...,x_n,a_1,...a_n]/(\sum x_ia_i-1)$, then the kernel of the map defined by the $1\times n$ matrix $(x_1^{m_1},\ldots x_n^{m_n})$ cannot be free unless $m_1\ldots m_n$ is divisible by $(n-1)!$.
If you want an example where the UFD property is obvious, Mohan Kumar's paper "On Stably Free Modules" gives a family of examples over rings of the form $A_f$ where the rings $A$ are polynomial rings over fields.  These examples all have the property that they become free after adding a free rank-one module.

A:

If Pete or someone else is still interested despite the fine answers already given, here is an analysis of what might be the simplest situation. Let $k$ be a field of characteristic $\neq 2$ and define $A=k[X,Y,Z]/(X^2+Y^2+Z^2-1)=k[x,y,z]$  where $X,Y,Z$ are indeterminates.
Proposition 1 (Nagata) The ring $A$ is a UFD iff $-1$ is not a square in $k$.
Sketch of proof:  If $-1=i^2$ for some $i\in k$,  the equality $x^2+y^2=(1+z)(1-z)$ shows that $A$ is not a UFD. In the other direction, if $-1$ is not a square, factoriality follows fairly easily from the following theorem of Nagata: if a noetherian domain $A$ has a prime element $t\in A$ such that $A[\frac{1}{t}]$ is a UFD, then $A$ was already a UFD.
Proposition 2 (Serre, Samuel)  Consider the module 
$M=A\partial _x \oplus A\partial _y \oplus A\partial _z$ (the free module of rank 3 over $A$ ) and its quotient $P=M/(x\partial _X+ y\partial _y+ z\partial _z)$ . Then $P$ is projective over $A$.
If moreover the field $k$ is formally real, then that module $P$ is not free over $A$.
Comments Formally real means that $-1$ is not a sum of squares in $k$. By Artin-Schreier theory this is equivalent to $k$ being orderable. Projectivity follows  from an easy explicit calculation. Non-freeness over $\mathbb R$ follows , by the Serre-Swan correspondence, from the well known theorem in topology that the tangent bundle to the  sphere is not trivial . In the general case of a formally real field  one resorts to logical trickery of Tarski type to reduce to the case $k=\mathbb R$. Interestingly up to a few years ago, experts assured me that there was no purely algebraic proof in the case of $\mathbb R$. I don't know if one has been found since. Finally, if $k=\mathbb C$ Serre has shown that $P$ is free (however,  by Proposition 1, the ring  $A$ is not a UFD in the case $k=\mathbb C$ )

A:

The simplest example I can think of is $\mathbb C[x_1, x_2, x_3, x_4, x_5]/(x_1^2 + x_2^2 + x_3^2 + x_4^2 + x_5^2 - 1)$. The proof I am going to give is almost certainly an overkill, a simpler approach should be possible. Call $X$ the spectrum of the algebra above. This is the ring of regular functions of the complement of a smooth projective quadric of dimension 3 in a smooth projective quadric of dimension 4. By standard results on Chow groups of quadrics, the Chow group of $X$ has rank 1 in dimension 2; hence the K-theory rings, which is rationally isomorphic to the Chow ring, has rank at least 2, and this implies  that there must be vector bundles on $X$ which are non-trivial. These correspond to non-free projective modules.

