This is the first in a series of papers in which we study the application of spectroastrometry in the context of gas kinematical studies aimed at measuring the mass of supermassive black holes. The spectroastrometrical method consists in measuring the photocenter of light emission in different wavelength or velocity channels. In particular we explore the potential of spectroastrometry of gas emission lines in galaxy nuclei to constrain the kinematics of rotating gas disks and to measure the mass of putative supermassive black holes. By means of detailed simulations and test cases, we show that the fundamental advantage of spectroastrometry is that it can provide information on the gravitational potential of a galaxy on scales significantly smaller (~ 1/10) than the limit imposed by the spatial resolution of the observations. We then describe a simple method to infer detailed kinematical informations from spectroastrometry in longslit spectra and to measure the mass of nuclear mass concentrations. Such method can be applied straightforwardly to integral field spectra, which do not have the complexities due to a partial spatial covering of the source in the case of longslit spectra.