Ramsey's method of separated oscillatory fields is applied to the excitation of the cyclotron motion of short-lived ions in a Penning trap to improve the precision of their measured mass values. The theoretical description of the extracted ion-cyclotron-resonance line shape is derived and its correctness demonstrated experimentally by measuring the mass of the short-lived 38Ca nuclide with an uncertainty of 1.1 x 10(-8) using the Penning trap mass spectrometer ISOLTRAP at CERN. The mass of the superallowed beta emitter 38Ca contributes for testing the theoretical corrections of the conserved-vector-current hypothesis of the electroweak interaction. It is shown that the Ramsey method applied to Penning trap mass measurements yields a statistical uncertainty similar to that obtained by the conventional technique but 10 times faster. Thus the technique is a new powerful tool for high-precision mass measurements.