We observed electrostatic solitary waves (ESW) in the Earth's foreshock region by the Geotail spacecraft. The foreshock region is classified into electron foreshock and ion foreshock regions, which are dominated by energetic electrons and superthermal ions, respectively. The Geotail waveform observations show the existence of ESW in both electron and ion foreshock regions. To understand the wave features of ESW, we examine the waveform and perform statistical analyses on the spatial distribution of the ESW. The results show that the occurrence and amplitude of ESW decrease as the distance from the bow shock transition increases. In the electron foreshock region, we find that ESW and electron beams are observed simultaneously. The plasma conditions are similar to those in the plasma sheet boundary layer (PSBL), in which ESW were first discovered by the Geotail spacecraft. In the ion foreshock region, ESW are simultaneously observed with superthermal ions reflected by the bow shock. We find two types of ESW in the ion foreshock region based on the orientation of their bipolar waveforms. We examine the angle between the magnetic field and the shock normal dependence of the occurrences of ESW in the ion foreshock region. The results show that ESW observed in the quasi-parallel shock have characteristics that differ from those observed in the quasi-perpendicular shock. From waveform and statistical analyses, the most plausible generation mechanism of the first type of ESW is the Buneman instability based on the superthermal ions and background electrons. A possible mechanism of the second type of ESW is the positive potential ESW propagating from the upstream region to the bow shock due to the reflection by the negative potentials or the negative potential ESW generated by the reflected superthermal ions.