When is  a surface in a threefold  contractible to a curve? Given  a threefold $Y$ containing a surface $S$. Under which conditions can I contract $S$ so that I still end up with a smooth variety?
In other words

what are the conditions for the
  existence of a smooth variety $X$ and
  a  morphism $Y\rightarrow X$ such that
  the image of $S$ under the morphism is
  a curve and the morphism is an
  isomorphism away from $S$?

What are the conditions when $Y$ is a fourfold and $S$ is still a surface?
 A: I think there are birational geometers lurking around who would do a better job. But let
me make a small attempt for now. If you blow up a smooth curve on a smooth threefold, 
you would get a ruled surface with normal bundle restricting to $O(-1)$ along the rulings.
I think you can do the converse if you allow yourself to work in the category of smooth algebraic spaces [see Artin, Cor. 6.11, Algebraization of formal moduli..., Annals 1970],
but such a statement is generally be false for varieties. I remember learning this from 
Moishezon long ago.
I think that if in addition to the above conditions, the fibre of the ruling is an extremal ray in Mori's sense, you can probably use his stuff to get a projective contraction. Take a look at Kenji Matsuki's book on the Intro. to the Mori program for more about that.
A: You want a divisorial contraction.  This paper may be the answer.


*

*MR2041612 (2005c:14019)  Tziolas,
Nikolaos . Terminal 3-fold
divisorial contractions of a surface
to a curve. I. Compositio Math.  139
(2003),  no. 3, 239--261.


from the paper "This paper studies divisorial contractions of a surface to a curve, i.e. when
dim $\Gamma = 1$ and X has only index 1 terminal singularities along $\Gamma$. It is not always true that given $\Gamma \subset X$, there is a terminal contraction of a surface to $\Gamma$. We investigate when there is one, give criteria for existence or not and in the case that there is a terminal contraction we also describe the singularities of Y."
A: You want a divisorial contraction $Y \to X$ on a smooth 3-fold $Y$. Extremal divisorial contractions (i.e., contractions associated to a $K_Y$-negative extremal ray in the Mori cone of $Y$) have been classified by S. Mori in his paper 
3-folds whose canonical bundles are not numerically effective, Annals of Mathematics 116, No. 1 (1982), pp. 133-176. 
Looking at Theorem 3.3, we see that here are exactly the following possibilities:


*

*the smooth blow-up of a point; in this case $S$ is isomorphic to $\mathbb{P}^2$ with normal bundle $\mathcal{O}(-1)$;

*the smooth blow-up of a curve, in this case $S$ is a ruled surface whose normal bundle restricted to the ruling has degree $(-1)$; this is the situation described by Donu Arapura in his answer;

*the contraction of a plane $S$ with normal bundle $\mathcal{O}(-2)$; in this case the 
surface  $X$ has an isolated singularity isomorphic to the quotient of $\mathbb{A}^3$ by the involution $(x,y,z) \to (-x, -y, -z)$;

*the contraction of a smooth quadric $S$ whose rulings are numerically equivalent; in this case the image of $S$ is a single point, which is a singular point for $X$;

*the contraction of a singular quadric $S$; again, the image of $S$ is a point in $X$.
Summing up, if you want that $X$ is smooth and the image of $S$ is a curve, the only possibility is 2. 
In the case where $Y$ is a smooth 4-fold and $S$ is a smooth surface, the answer can be found in the paper of Kawamata "Small contractions of four-dimensional algebraic manifolds": in this case the only possibility is that $S$ is the disjoint union of copies of $\mathbb{P}^2$, with normal bundle $\mathcal{O}(-1) \oplus \mathcal{O}(-1)$
