We investigate the analogy between squarefree Cohen-Macaulay modules supported on a graph and line bundles on a curve. We prove a Riemann-Roch theorem, we study the Jacobian and gonality of a graph, and we prove Clifford's theorem. (c) 2012 Elsevier B.V. All rights reserved.