Let $(X,o)$ be a normal complex surface singularity. We define an invariant $p_e(X,o)$ for $(X,o)$ in terms of pencils of compact complex curves. Similarly, for a pair of $(X,o)$ and $h \in {\mathfrak m}_{X,o}$ (the maximal ideal of $\mathscr{O}_{X,o}$ ), we define an invariant $p_e(X,o,h)$ . We call $p_e(X,o)$ (resp. $p_e(X,o,h)$ ) the pencil genus of $(X,o)$ (resp. a pair of $(X,o)$ and $h$ ). In this paper, we give a method to construct pencils of compact complex curves by gluing a resolution space of $(X,o)$ and resolution spaces of some cyclic quotient singularities. Using this, we prove some formulae on $p_e(X,o,h)$ and estimate $p_e(X,o)$ . We also characterize Kodaira singularities in terms of $p_e(X,o,h)$ .