  We provide a numerical method to calculate comprehensively the microwave and
the laser spectra of ultracold bosonic atoms in optical lattices at finite
temperatures. Our formulation is built up with the sum rules, up to the second
order, derived from the general principle of spectroscopy. The sum rule
approach allows us to discuss the physical origins of a spectral peak shift and
also a peak broadening. We find that a spectral broadening of superfluid atoms
can be determined from number fluctuations of atoms, while that of normal-state
atoms is mainly attributed to quantum fluctuations resulting from hopping of
atoms. To calculate spectra at finite temperatures, based on the sum rule
approach, we provide a two-mode approximation assuming that spectra of the
superfluid and normal state atoms can be calculated separately. Our method can
properly deal with multi-peak structures of spectra resulting from thermal
fluctuations and also coexisting of the superfluid and the normal states. By
combining the two-mode approximation with a finite temperature Gutzwiller
approximation, we calculate spectra at finite temperatures by considering
realistic systems, and the calculated spectra show nice agreements with those
in experiments.
