We consider a fan as a ringed space (with finitely many points). We develop the corresponding sheaf theory and functors, such as direct image Rπ* (π is a subdivision of a fan), Verdier duality, etc. The distinguished sheaf ${\cal L}_\Phi$, called the minimal sheaf plays the role of an equivariant intersection cohomology complex on the corresponding toric variety (which exists if Φ is rational). Using ${\cal L}_\Phi$ we define the intersection cohomology space IH(Φ). It is conjectured that a strictly convex piecewise linear function on Φ acts as a Lefschetz operator on IH(Φ). We show that this conjecture implies Stanley's conjecture on the unimodality of the generalized h-vector of a convex polytope.