Picard group of scheme over DVR

Let $A$ be a DVR and let $X/A$ be a smooth, proper scheme with geometrically integral fibers. Is there an easy way to see that the Picard group of $X$ is isomorphic to the Picard group of the generic fiber $X_\eta$ of $X$?

-

Here is an argument, which hopefully is not too dodgy:

Firstly, if $D_{\eta}$ is an effective divisor on $X_{\eta}$, then the Zariski closure $D$ of $D_{\eta}$ will be an effective divisor on $X$. Since $Pic(X_{\eta})$ is generated by the classes of effective divisors, this shows that the restriction map from $Pic(X)$ to $Pic(X_{\eta})$ is surjective.

Now let $\mathcal L$ be a line bundle on $X$ which is trivial when restricted to $X_{\eta}$. If we choose a non-zero section $f$ of $\mathcal L_{\eta}$, then multiplying by a sufficiently high power of $\pi$ (a uniformizer of $A$), we may assume that $f$ extends to a section of $\mathcal L$. The zero locus of $f$ is then some multiple of $X_s$ (the special fibre). This is precisely the zero locus of $\pi$, and so scaling again by an appropriate power of $\pi$, we may assume that $f$ is actually nowhere zero, showing that $\mathcal L$ is trivial.

Note: I am assuming that the special fibre is irreducible. [Edit: As Laurent Moret-Bailly points out below, what follows is incorrect, due to a confusion between connectedness and geometric connectedness. New Edit: As Qing Liu points out in his answer, while the argument given is not quite correct, the conclusion is actually okay!] But I think the general case reduces to this. Namely, since $X$ is smooth over $A$, each connected component is irreducible, hence has connected generic fibre, hence has connected special fibre (Zariski's connectedness theorem), hence has irreducible special fibre (since the special fibre is also smooth by assumption). Thus the above argument, if it is correct, should apply to each connected component separately.

Additional remark: Although I switched into the language of line bundles half-way through the above argument, this is not necessary (it is just the first thing that came to mind when I initially wrote the answer). It is perhaps cleaner to think entirely in terms of restricting effective divisors $D$ on $X$ to $X_{\eta}$, and extending effective divisors on $X_{\eta}$ to all of $X$ by taking Zariski closure. One easily sees that these operations provide an isomorphism between $Pic(X)$ and $Pic(X_{\eta})$, provided that every divisor supported on the special fibre is principal. If the special fibre is irreducible, then there is only one reduced effective divisor supported on the special fibre, namely the special fibre itself, and this is principal, being cut out by the equation $\pi = 0$. What Qing Liu's answer shows is that even if $X_s$ is reducible, it is still the case that it breaks up as a disjoint union of components, each of which is principal.

-
@Matthew: the last paragraph is wrong. Let $A'$ be the normalization of $A$ in a quadratic extension $K'$ which is unramified and split. Take $X=\mathbb{P}^1_{A'}$ (viewed as an $A$-scheme). The generic fibre is $\mathbb{P}^1_{K'}$; the special fibre is $\mathbb{P}^1_{k}\coprod\mathbb{P}^1_{k}$ ($k$=residue field). In this example, $\mathrm{Pic}(X_\eta)\cong\mathbb{Z}$ while $\mathrm{Pic}(X)\cong\mathbb{Z}\times\mathbb{Z}$. –  Laurent Moret-Bailly Jan 15 '11 at 8:57
Dear Laurent, Thanks for this. Regards, Matthew –  Emerton Jan 15 '11 at 12:55
This is too long to be a comment to Matt Emerton's answer. I think his conclusion is correct. Namely, if $X$ is smooth and proper over $A$, then $\mathrm{Pic}(X)\to \mathrm{Pic}(X_{\eta})$ is an isomorphism (whenever the generic fiber is geometrically connected or not). As explained by Matt, one can suppose $X$ is connected and we have only to show the injectivity. Clearly the kernel is generated by the irreducible components of the special fiber $X_s$. So it is enough to show that each of these irreducible components is a principal (Cartier) divisor.
Frist consider $A'=H^0(X, \mathcal O_X)$. It is finite and flat over $A$. As $X_s=X\otimes_{A'} (A'/\pi A')$ where $\pi$ is a uniformizing element of $A$, is smooth over $A/\pi A$, this force $A'/\pi A'$ to be separable over $A/\pi A$, hence $A'$ is étale over $A$.
The scheme $X$ is also a smooth proper $A'$-scheme with geometrically connected generic fiber. Let $s_1,\dots, s_n$ be the points of Spec$(A')$. Then $A'/\pi A'=\oplus_i k(s_i)$ and $X_s$ is just the disjoint union of the $X_{s_i}$. By Zariski, $X_{s_i}$ is connected, smooth, hence irreducible. Let $\pi_i\in A'$ be a uniformizing element at $s_i$ and a unit at $s_j$ for all $j\ne i$. Then the divisor div$(\pi_i)$ of $\pi_i$ on $X$ is $X_{s_i}$.
In Laurent's example, each copy of $\mathbb P^1_k$ is actually a principal divisor. So there is no more divisors on $\mathbb P^1_{A'}$ than on $\mathbb P^1_{\mathrm{Frac}(A')}$. Hope I don't miss something.
Shame on me. What was wrong in Matt's argument was the claim that the special fiber is irreducible, but as you show the conclusion nevertheless holds. What happens in my example is that if $L$ is an invertible sheaf on $X$, its restrictions to both components of $X_s$ must have the same degree. –  Laurent Moret-Bailly Jan 18 '11 at 15:21