The optical Ramsey spectrum is experimentally realized in an 87Sr optical lattice clock, and the measured linewidth agrees well with theoretical expectation. The coherence time between the clock laser and the atoms, which indicates the maximum free evolution period of using Ramsey detection to measure the atom-laser phase information, is determined as 340(23) ms by measuring the fringe contrasts of the Ramsey spectrum as a function of the free evolution period. Furthermore, with the same clock duty cycle of about 0.1, the clock stability is measured by using the Ramsey and Rabi spectra, respectively. The experimental and theoretical results show approximately the same stability as the two detection methods, which indicates that Ramsey detection cannot obviously improve the clock stability until the clock duty cycle is large enough. Thus, it is of great significance to choose the detection method of a specific clock.