Picard group of generic fibre Let $C$ be an irreducible curve over a field $k$ and let $X$ be a $k$-variety equipped with a morphism $f: X \to C$. Let $X_{k(C)} \to k(C)$ be the generic fibre of this morphism. Under which "reasonable" conditions on $X$, $C$ and/or $f$ (smoothness, properness and so on) will the natural sequence
$$\text{Pic}\,C \to \text{Pic}\,X \to \text{Pic}\,X_{k(C)} \to 0$$
be exact? For example, does this hold if $X$, $C$ and $f$ are smooth and proper?
 A: You have to suppose $X\to C$ flat to avoid empty generic fiber. 
Assume $X$ is regular and flat over $C$. 
Then $\mathrm{Pic}(X)\to \mathrm{Pic}(X_K)$, where $K=k(C)$, is surjective. Indeed, identifying invertible sheaves (up to isomorphism) to Weil divisors (up to linear equivalence), it is enough to show that any point of codimension $1$  $P$ in $X_K$ extends to a divisor on $X$. It then suffices to take the Zariski closure of $\{ P\}$.  
Now let us look at the exactness at middle. An element of $\mathrm{Pic}(X)$ is in the kernel of $\mathrm{Pic}(X)\to \mathrm{Pic}(X_K)$ if and only if it is represented by a Weil divisor on $X$ supported in finitely many closed fibers of $X\to C$: 
(1) if $\mathcal L\in \mathrm{Pic}(X)$ is trivial on $X_K$, dividing by a rational section which is a basis on $X_K$, we can suppose that $\mathcal L$ is a subsheaf of $K(X)$ and equal to $O_X$ on an open subset $U$ containning $X_K$. So $\mathcal L=O_X(D)$ for some Cartier divisor $D$ supported in $X\setminus U$. As $F=f(X\setminus U)$ is constructible hence finite, $D$ is supported in $f^{-1}(F)$. 
(2) Conversely, a divisor supported in a finite union of closed fibers is clearly trivial on $X_K$. 
So the exactness at the middle is equivalent to saying that any vertical divisor is principal. Note that $f(X)$ is open in $C$ and $f(X)$ is regular because $X$ is regular and $X\to f(X)$ is faithfully flat. Now it is enough (and essentially necessary) to suppose the fibers of $X\to C$ are integral because every closed fiber $X_s$ is then a principal divisor (if $s\notin f(X)$, there is nothing to prove; if $s\in f(X)$, then $[s]$ is a principal divisor and so is $[X_s]=f^*[s]$). 
A: Let $f\colon X\to C$ be a faithfully flat morphism of locally noetherian schemes which is either quasi-compact or locally of finite type, where $C$ is normal and integral with function field $K$. Assume that, for every point $s\in C$ of codimension $1$, the fiber $X_{s}$ is integral. Then the canonical sequence
$$
{\rm Pic}\, C\to {\rm Pic}\, X\to {\rm Pic}\, X_{K}
$$
is exact. This result is due to Raynaud (see EGA, ${\rm Err}_{\,\rm IV}$, 53, Corollary 21.4.13, p. 361). If, in addition, $X$ is locally factorial, then the right-hand map above is surjective. The following proof of the latter surjectivity was sent to me by Cedric Pepin. By EGA, ${\rm IV}_{4}$, Corollary 21.6.10(ii), the latter map can be identified with the map of divisor class groups ${\frak{Cl}}\, X\to {\frak{Cl}}\, X_{K}$. Thus it suffices to check that every closed and irreducible subscheme $D_{K}$ of codimension 1 in $X_{K}$ extends to a closed and irreducible subscheme $D$ of codimension 1 in $X$. Since ${\rm Spec}\, K\to C$ is quasi-compact, the canonical morphism $D_{K}\to X$ is quasi-compact as well and the schematic closure $D$ of $D_{K}$ in $X$ is defined by EGA 1 (new), Corollary 6.10.6, p. 325. Since $D$ is closed and irreducible of codimension 1 in $X$, the proof is complete. If anyone knows a statement that is more general than the above, please let me know!
