Geosteering is a key technique to increase oil- and gas-production rates, especially within a thin reservoir layer. The purpose of geosteering in the production zone is to keep the drilling path in oil- and gas-bearing reservoirs. To keep the drilling system inside the production zone, downhole sensors must be able to detect bed boundaries, which include identifying the boundary location with respect to the sensor and the boundary distance from the sensor. We have developed a directional resistivity logging-while-drilling (LWD) tool for geosteering applications. The directional LWD tool is equipped with a joint-coil antenna composed of an axially polarized coil Rz connected in series with two transversely polarized coils Rx. During a revolution around the axis of the tool, the voltage of the axial coil VRz, voltage of the transverse coils VRx, and tool face angle , which indicates the boundary direction, can be extracted through curve fitting the total voltage response of the joint-coil antenna. The distance to the boundary can be derived from a 1D inversion. The LWD tool has been tested in several reservoirs in China, and it has a demonstrated capability to provide reliable and accurate estimations of the boundary direction and distance. Field data indicate that the boundary detection depth can reach 2.1 and 1.7 m when the tool is in a sand and shale formation. Using wireline-logging data from surrounding wells as reference, deviations between the reference and the measured distance to the boundary are within 0.2 m.