Lineshape of cooperative two-photon absorption by atom pairs in solids