The generation of wakefields in near-critical density plasma by a short laser pulse is considered. The equations describing the plasma response to the acting laser pulse and the Hamiltonian of an electron in the wakefield are derived by using the Hamilton-Jacobi equation for the cases of nu (g) similar or equal to nu (p) similar or equal to w = c w < c (e is the speed of light). The equations are solved analytically in two cases for a square-shaped laser pulse. The plasma potential inside the laser pulse and the wakefield potential excited by the laser pulse are obtained. The optimal length of the driving laser pulse and the wavelength of the wake are expressed by the group velocity.