We introduce and study the notion of representation up to homotopy of a Lie algebroid, paying special attention to examples. We use representations up to homotopy to define the adjoint representation of a Lie algebroid and show that the resulting cohomology controls the deformations of the structure. The Weil algebra of a Lie algebroid is defined and shown to coincide with Kalkman's BRST model for equivariant cohomology in the case of group actions. The relation of this algebra with the integration of Poisson and Dirac structures is explained in [Arias Abad, Crainic, Ann. Inst. Fourier].