I'll just talk about the calculation of $\text{Pic}(\mathcal{M}_g)$ as a group (showing that it is generated by the Hodge bundle is then a calculation).
I think the most elementary way to view this problem is to think in terms of orbifolds rather than stacks. Recall that $\mathcal{M}_g$ is the quotient of Tecichmuller space $\mathcal{T}_g$ by the mapping class group $\text{Mod}_g$ (this is the curves analogue of $\mathcal{A}_g$ being the quotient of the Siegel upper half plane by the symplectic group). This action is properly discontinuous but not free (that's why we have an orbifold/stack rather than an honest space). A line bundle on $\mathcal{M}_g$ is then a $\text{Mod}_g$-equivariant line bundle on $\mathcal{T}_g$. There is an equivariant first Chern class homomorphism $c_1 : \text{Pic}(\mathcal{M}_g) \rightarrow H^2(\text{Mod}_g;\mathbb{Z})$. Mumford showed that $H^1(\text{Mod}_g;\mathbb{Z})=0$, so $\text{Pic}(\mathcal{M}_g)$ cannot vary continuously. This implies that $c_1$ is injective. Later, Harer proved that $H^2(\text{Mod}_g;\mathbb{Z}) \cong \mathbb{Z}$ for $g$ large. Since the Hodge bundle is nontrivial, $c_1$ cannot be the zero map, so we conclude that $\text{Pic}(\mathcal{M}_g) \cong \mathbb{Z}$.
Let me now recommend three places that contain more details about the above point of view. First, Hain has a survey entitled "Moduli of Riemann Surfaces, Trancendental Aspects", a large portion of which is devoted to the calculation of the Picard group. He gives many more details of the above sketch. He also shows how to show that the Hodge bundle generates the Picard group. Second, in the first couple of sections of my paper "The Picard Group of the Moduli Space of Curves With Level Structures" I give some extra details about things like Chern classes of orbifold line bundles. Finally, Hain has another survey "Lectures on Moduli Spaces of Elliptic Curves" in which he works all the above out for the moduli space of elliptic curves, where things are a little more concrete.