We consider surfaces immersed in three-dimensional pseudohermitian manifolds. We define the notion of (p-)mean curvature and of the associated (p-)minimal surfaces, extending some concepts previously given for the (flat) Heisenberg group. We interpret the p-mean curvature not only as the tangential sublaplacian of a defining function, but also as the curvature of a
characteristic curve, and as a quantity in terms of calibration geometry.
As a differential equation, the p-minimal surface equation is degenerate
(hyperbolic and elliptic). To analyze the singular set, we formulate some {\em
extension} theorems, which describe how the characteristic curves meet the
singular set. This allows us to classify the entire solutions to this equation
and to solve a Bernstein-type problem (for graphs over the $xy$-plane) in the
Heisenberg group $H_1$. In $H_{1}$, identified with the Euclidean space
$R^{3}$, the p-minimal surfaces are classical ruled surfaces with the rulings
generated by Legendrian lines. We also prove a uniqueness theorem for the
Dirichlet problem under a condition on the size of the singular set in two
dimensions, and generalize to higher dimensions without any size control
condition. We also show that there are no closed, connected, $C^{2}$ smoothly immersed constant p-mean curvature or p-minimal surfaces of genus greater than one in the standard $S^{3}.$ This fact continues to hold when $S^{3}$ is replaced by a general spherical pseudohermitian 3-manifold.