Factoriality of cones Let $X\subset\mathbb{P}^n\subset\mathbb{P}^N$ be a smooth irreducible projective complex variety, $L\subset\mathbb{P}^N\setminus\mathbb{P}^n$ be a linear $(N-n-1)$-dimensional variety and consider the cone $Y=C_L(X)=\bigcup_{p\in L \atop x\in X} \langle p,x \rangle\subset\mathbb{P}^N$.
Is it true that $Y$ is locally factorial (i.e. all its local rings are UFD) ?
Thanks.
 A: Let me describe a situation where your statement is true.
Let $X \subset \mathbb{P}^n$ be any smooth, projectively normal subvariety of the projective space and let $C(X)$ be the projecting cone over $X$, with vertex the point  $p$. Then $C(X)$ is factorial  (i.e. the coordinate ring of $C(X)$ is a UFD) if and only if the following condition holds:
(1) every irreducible codimension one subvariety of $X$ is cut out (scheme theoretically) by a hypersurface of the ambient space.
Since the localization of a noetherian UFD is still a UFD, this implies that if (1) holds then $C(X)$ is also locally factorial, i.e. the local ring at the vertex $\mathscr{O}_{X, p}$ is a UFD. Notice that the local rings at the smooth points are automatically UFDs, since they are regular local rings  (Auslander-Buchsbaum theorem).      
Condition (1) is satisfied in the following cases:
(1a) $X \subset \mathbb{P}^3$ is very general surface of degree $d \geq 4$ (Noether-Lefschetz theorem);
(1b) $X \subset \mathbb{P}^n$ is a smooth, complete intersection with $\dim X \geq 3$ (Lefschetz theorem on hyperplane sections); 
(1c) $X$ is a Grassmannian embedded by the Plucker embedding.
One can also ask when $C(X)$ is analitically locally factorial, i.e. when the complete ring $\widehat{\mathscr{O}}_{X, p}$ is a UFD. By a theorem of Mori, this condition implies local factoriality, but in general the converse is not true. If (1) holds, a sufficient condition for analytic local factoriality is the following:
(2) $H^1(X, \mathscr{O}_X(n))=0$ for all $ n >0$. 
Condition (2) is satisfied, for instance, when $X$ is a complete intersection and $\dim X \geq 2$.
For further details you can look at Lipman's paper Unique factorization in complete local rings, in  Algebraic geometry (Proc. Sympos. Pure Math., Vol. 29, Humboldt State Univ., Arcata, Calif., 1974), pp. 531–546. Amer. Math. Soc., Providence, R.I., 1975.
The paper is freely available on the web.
A: Although Francesco answered this quite thoroughly let me add a comment that might help understanding what's going on and how this can fail.
Note that as long as $X$ is smooth, the only question is whether the cone is locally factorial at the vertex, since everywhere else it is smooth.
Example
Take $X=\mathbb P^1\times \mathbb P^1\hookrightarrow \mathbb P^n$ with an arbitrary embedding to $\mathbb P^n$. This example, of course, already fails condition (1) from Francesco's criterion on account of having Picard number $2$. In particular, the rulings cannot be cut out by hypersurfaces since they are not ample. 
On the other hand it is very easy to see that the cone over this $X$ is not locally factorial. 
First, if you just take the usual embedding of $X$ in $\mathbb P^3$, then $X=Z(xy-zt)$ and the cone over this is then $\mathrm{Spec}\\, k[x,y,z,t]/(xy-zt)$, which is clearly not a UFD and still not a UFD after localizing at $(0)$, since $\bar x\bar y=\bar z\bar t$. 
Second, there is a more telling reason why this is not factorial. Let $\ell\simeq \mathbb P^1$ be a member of one of the rulings on $X$. Then $C(\ell)$ is a Weil divisor on $C(X)$. It is a relatively easy computation (or thinking about geometrically what blow up means) to show that blowing up $C(X)$ along $C(\ell)$ results in a small morphism which is not the identity (the exceptional set is isomorphic to $\ell$). This implies that $C(\ell)$ is not a Cartier divisor on $C(X)$ and hence the local ring of $C(X)$ at the vertex cannot be factorial. This is the crux of the condition Francesco mentioned. If the local ring at the vertex is factorial, then every Weil divisor is Cartier, in particular the cone over any irreducible divisor of $X$ is a Cartier divisor at the cone. Take a local equation there, this will give a global equation for the original divisor and hence it has to be cut out by a hypersurface.
Third, this example is actually an example for a little more. The above argument can be repeated for any multiple of $C(\ell)$ which shows  that it is not only not Cartier, but also not $\mathbb Q$-Cartier.
A: One obvious obstruction to factoriality of the cone: for the cone over $X$ to be factorial, $X$ must be at least projectively normal (i.e., $H^0(\mathcal O_{\mathbb P^n}(k))$ should map surjectively onto $H^0(\mathcal O_X(k))$ for all $k>0$. Thus, any projective variety that is an isomorphic projection of a variety in $\mathbb P^{n+1}$, is a counterexample.
A: A result of Popov and Vinberg  gives a positive case.
For a simply-connected semi-simple algebraic group $G$ in characteristic zero.
they consider the orbits of the highest weight vectors under in irreducible representations.
Then the cones over these orbits  are factorial varieties  for fundamental representations.
