Let $X$ be a smooth projective variety, $A$ a complete discrete valuation ring, $Y=\mbox{Spec} A$ and $f:X \to Y$ a smooth, projective, surjective morphism. Denote by $y$ the closed point of $Y$. Let $\mathcal{L}$ and $\mathcal{M}$ be two line bundles on $X$ such that its restrictions to the fiber $X\_y$ over $y$ are isomorphic, i.e., $\mathcal{L}\otimes \mathcal{O}\_{X\_y} \cong \mathcal{M} \otimes \mathcal{O}\_{X\_y}$. Does this imply that there exist a line bundle $\mathcal{N}$ on $Y$ such that $\mathcal{L} \cong \mathcal{M} \otimes f^\*\mathcal{N}$?


Note that this is in some sense a generalization of Ex. III.12.4 of Hartshorne, "Algebraic Geometry".



An application of the Grauert's upper semi-continuity theorem
No. First of all note that your line bundle $\mathcal{N}$ on $Y$ is trivial, so your assertion is $\mathcal{L}\cong\mathcal{M}$. 


Take a smooth projective curve $C$ of genus $\geq 1$ (say over $\mathbb{C}$), with a closed point $p$. Consider the first projection $f:C\times C\rightarrow C$, and take for $\mathcal{L}$, resp. $\mathcal{M}$, the line bundle on $C\times C$ associated to the diagonal, resp. to $C\times \{p\} $. Then $\mathcal{L}$ and $\mathcal{M}$ have isomorphic restrictions to $f^{-1}(p)$, but not to the other fibers. Now take $A=\mathcal{O}\_{C,p}$, and restrict to $Y\times C\rightarrow Y$.


