Complementing the earlier answers:

In genus zero, a very useful reference is Ezra Getzler, "[Operads and moduli spaces of genus 0 Riemann surfaces](https://arxiv.org/abs/alg-geom/9411004)". He determines generating series for the $\Sigma_n$-equivariant Poincaré polynomials of $\overline M_{0,n}$ and $M_{0,n}$, and proves the purity of the cohomology of $M_{0,n}$: the cohomology group $H^i(M_{0,n})$ carries a pure Hodge structure of weight $2i$ (of Tate type). 

Also two small remarks on algori's answer. (i) If I am not mistaken, the quotient map $F(\mathbf P^1,n) \to M_{0,n}$ is in fact a trivial $\mathrm{PGL}_2$-bundle, since it has a section given by putting the first three points at $0$, $1$ and $\infty$. So things are even simpler. (ii) If you don't care about the $\Sigma_n$-equivariance, then you can use exactly the same tool (the Cohen-Taylor-Totaro spectral sequence) but consider instead the configuration space $$ M_{0,n} \cong F(\mathbf P^1 \setminus \{0,1,\infty\},n-3). $$
Since $\mathbf P^1$ minus three points has $H^0$ of weight $0$ and $H^1$ of weight $2$, and the differentials are compatible with weights, it follows that the spectral sequence degenerates immediately so one can directly read off the Betti numbers and the purity.

In genus one, there is a recent [preprint](https://arxiv.org/abs/1303.5693) of Gorinov that determines the cohomology of $M_{1,n}$ with its Hodge structure. I believe that what he does is the following: 

Consider the configuration space of $n$ points on an elliptic curve, $F(E,n)$, quotiented by the action of $E$ by translation. The cohomology of this space can be computed via the Cohen-Taylor-Totaro spectral sequence. If you are careful you can even determine how the cohomology of $F(E,n)/E$ is built out of (symmetric powers of) $H^1(E)$ and some Tate twists. 

Now consider the forgetful map $\pi \colon M_{1,n}\to M_{1,1}$. The results of the previous paragraph tell you how the local systems $R^i \pi_\ast \mathbf Q$ are built out of symmetric powers of the "standard local system", which is $R^1\pi_\ast \mathbf Q$ for $n=1$. Finally, the cohomology of these local systems is given by Eichler-Shimura theory; the cohomology groups are canonically given by spaces of modular forms for $\mathrm{SL}(2,\mathbf Z)$. As far as I can tell, the Eichler-Shimura theory is the only part which is specific to genus one: everything else would work without changes in higher genus as well. 

Maybe I should mention at this point that there is plenty to read about how to compute the cohomology of these local systems on $M_g$ when $g \geq 2$. For $g=2$ and $g=3$ you can read a sequence of papers of Faber, van der Geer and Bergström, who work on computing/conjecturing Euler characteristics of these local systems in the Grothendieck group of $\ell$-adic Galois representations by means of point counts. The Euler characteristic doesn't give you the cohomology, but it gives you partial information. In particular because you know that these local systems are pulled back from $A_g$, and on $A_g$, most cohomology groups of these local systems vanish. (There is a wealth of information in [Faltings-Chai](https://doi.org/10.1007/978-3-662-02632-8), chapter 6.) Then you can apply the Gysin exact sequence for the image of $M_g$ in $A_g$ under the Torelli map. 

Let me finally make a few remarks on genus two. If you only want the Betti numbers (i.e. you don't care about torsion), then there are easier ways than the papers linked by Oscar Randal-Williams. When $n=0$, there is an isomorphism $M_2 \cong M_{0,6}/\Sigma_6$ on coarse moduli spaces: every curve of genus two is hyperelliptic, and a hyperelliptic curve is uniquely determined by the $2g+2$ branch points on $\mathbf P^1$ under the hyperelliptic map. So rationally, you need only to take the $\Sigma_6$-invariants in Getzler's description of the cohomology of $M_{0,n}$, and you find that $M_2$ has the rational cohomology of a point.

When $n=1$, you apply the Leray spectral sequence for $\pi \colon M_{2,1} \to M_2$. The local systems $R^0\pi_\ast\mathbf Q$ and  $R^2\pi_\ast\mathbf Q$ are trivial, and $R^1\pi_\ast\mathbf Q$ has no cohomology since every point of $M_2$ has the hyperelliptic involution in its automorphism group, which acts as multiplication by $-1$ on the fibers of the latter local system (this also uses that you take rational coefficients). You conclude that $H^\ast(M_{2,1}) \cong H^\ast(\mathbf P^1)$. 

Note that this generalizes to hyperelliptic curves of any genus: you always have that $H_g$ has the rational cohomology of a point, and $H_{g,1}$ the cohomology of $\mathbf P^1$. 

For $n=2$ you need to compute the cohomology of the local systems $V_{2}$ and $V_{1,1}$ on $M_2$. Getzler manages to determine all but two Betti numbers without this information in "[Topological recursion relations in genus two](https://arxiv.org/abs/math/9801003)" and expresses the final Betti numbers in terms of their cohomology. The cohomology of these local systems can be found in the more recent paper by Hulek and Tommasi, "[Cohomology of the second Voronoi compactification of $A_4$](https://doi.org/10.4171/dm/366)", Appendix A. (This appendix also contains some things useful for $M_3$.) Together these papers determine the Betti numbers of $M_{2,2}$. I would guess that you can compute also the Betti numbers of $M_{2,3}$ from this information, since the only "new" local systems that appear for $n=3$ have odd weight so their cohomology vanishes, but I have not sat down to compute the Leray spectral sequence here.

The Betti numbers for $M_{2,4}$ I suspect are unknown. Tom Church writes above that they can be found in Bergström-Tommasi, but I think this is a misreading of their paper. As Tom writes, much of the paper of Bergström and Tommasi summarizes their previous work, done separately and by different methods. Tommasi's work uses the Vassiliev-Gorinov method of computing the cohomology of complements of discriminants. This gives you the Poincaré-Serre polynomial, and in particular the Betti numbers. Bergström uses point counts over finite fields, which gives you the Euler characteristic in the category of $\ell$-adic Galois representations (or what they call the Hodge Euler characteristic), but NOT in general the Betti numbers. The results on $M_{2,n}$ are due to Bergström in "[Equivariant counts of points of the moduli spaces of pointed hyperelliptic curves](https://eudml.org/doc/229016)".