Is there a relative version of sheaf cohomology? EDIT: I rather mean the cohomology of pairs.

It turns out that my previous answer dealt with the wrong question. The answer to the new question is also yes: local cohomology $H\_Z(X,\mathcal F)$ corresponds to cohomology of the pair $(X,X\setminus Z)$. 


To elaborate on Kevin's comment: If $f: X \to S$, and $\mathcal F$ is a sheaf on $X$, then $f\_*\mathcal F$ is the sheaf on $S$ defined by $H^0(U,f\_*\mathcal F) := H^0(f^{1}(U),\mathcal F).$ Taking the derived functors of $f\_*$ gives functors $R^if\_*$, and it turns out (fairly easily) that $R^if\_*(\mathcal F)(U)$ is the sheaf associated to the presheaf $U \mapsto H^i(f^{1}(U),\mathcal F)$. If $i > 0,$ then this presheaf may not be a sheaf (unlike the $i = 0$ case), and this is related to the fact that it can be a little subtle to compute the stalks of $R^if\_*\mathcal F$ in general; for example, it need not be the case in general that the stalk $(R^if\_*\mathcal F)_s$ is equal to $H^i(f^{1}(s),\mathcal F)$. (E.g. think about the case when $f$ is the inclusion of a punctured disk into a disk, $\mathcal F$ is the constant sheaf ${\mathbb Z}$, and $s$ is the centre of the disk (so that $f^{1}(s)$ is empty).) In other words, $R^if\_*\mathcal F$ does not always literally interpolate the cohomology of the fibres. There is one case where one knows that $R^if\_*\mathcal F$ does interpolate the cohomology of the fibres: if the map $f$ is proper, than the proper basechange theorem says that the stalk of $R^if\_*\mathcal F$ at $s$ is the cohomology of $\mathcal F$ along the fibre of $s$. (One good place for these kinds of facts is the beginning of Borel's book on Intersection Cohomology.) Also, in the context of maps of varieties, if $f$ is proper and $\mathcal F$ is a coherent sheaf, then the completed stalk of $R^if\_* \mathcal F$ at $s$ coicides with the cohomology of the pullback of $\mathcal F$ to the formal completion of $f^{1}(s)$ in $X$. (This is Grothendieck's proper basechange theorem, proved in some form in Hartshorne, Ch. III.) 


I would think  but this is for the moment a thought, not meant as an authorative answer  that every notion of cohomology whatsoever has a relative version in this sense. I am thinking here of the general abstract definition of cohomology as exposed at nLab:cohomology. This includes in particular the special case of sheaf cohomology as described there in some detail. What I expect the fully general notion of relative cohomology from this point of view to be I have now briefly indicated at relative cohomology. I'd believe this does in particular reproduce the definition given in Emerton's answer. 

