Determining the effect of structural perturbations on the eigenvalue spectra of networks is an important problem because the spectra characterize not only their topological structures, but also their dynamical behavior, such as synchronization and cascading processes on networks. Here we develop a theory for estimating the change of the largest eigenvalue of the adjacency matrix or the extreme eigenvalues of the graph Laplacian when small but arbitrary set of links are added or removed from the network. We demonstrate the effectiveness of our approximation schemes using both real and artificial networks, showing in particular that we can accurately obtain the spectral ranking of small subgraphs. We also propose a local iterative scheme which computes the relative ranking of a subgraph using only the connectivity information of its neighbors within a few links. Our results may not only contribute to our theoretical understanding of dynamical processes on networks, but also lead to practical applications in ranking subgraphs of real complex networks.