Let $A$ be an $n\times n$ symmetric, irreducible, and nonnegative matrix whose eigenvalues are $\lambda _1 > \lambda _2 \ge \ldots \ge \lambda _n$. In this paper we derive several lower and upper bounds, in particular on $\lambda _2$ and $\lambda _n$, but also, indirectly, on $\mu = \max _{2\le i \le n} |\lambda _i|$. The bounds are in terms of the diagonal entries of the group generalized inverse, $Q^{\#}$, of the singular and irreducible M-matrix $Q=\lambda _1 I-A$. Our starting point is a spectral resolution for $Q^{\#}$. We consider the case of equality in some of these inequalities and we apply our results to the algebraic connectivity of undirected graphs, where now $Q$ becomes $L$, the Laplacian of the graph. In case the graph is a tree we find a graph-theoretic interpretation for the entries of $L^{\#}$ and we also sharpen an upper bound on the algebraic connectivity of a tree, which is due to Fiedler and which involves only the diagonal entries of $L$, by exploiting the diagonal entries of $L^{\#}$.