We present a formalism of distorted wave impulse approximation (DWIA) for analyzing spin observables in nucleon inelastic and charge exchange reactions leading to the continuum. It utilizes response functions calculated by the continuum random phase approximation (RPA), which include the effective mass, the spreading widths and the \Delta degrees of freedom. The Fermi motion is treated by the optimal factorization, and the non-locality of the nucleon-nucleon t-matrix by an averaged reaction plane approximation. By using the formalism we calculated the spin-longitudinal and the spin-transverse cross sections, ID_q and ID_p, of 12C, 40Ca (\vec{p},\vec{n}) at 494 and 346 MeV. The calculation reasonably reproduced the observed ID_q, which is consistent with the predicted enhancement of the spin-longitudinal response function R_L. However, the observed ID_p is much larger than the calculated one, which was consistent with neither the predicted quenching nor the spin-transverse response function R_T obtained by the (e,e') scattering. The Landau-Migdal parameter g'_N\Delta for the N\Delta transition interaction and the effective mass at the nuclear center m^*(r=0) are treated as adjustable parameters. The present analysis indicates that the smaller g'_{N\Delta}(\approx 0.3) and m^*(0) \approx 0.7 m are preferable. We also investigate the validity of the plane wave impulse approximation (PWIA) with the effective nucleon number approximation for the absorption, by means of which R_L and R_T have conventionally been extracted.