Interplay between the gravitational and capillary pressure forces at the interfaces of sands with different capillarity properties determines the fate of nonaqueous phase liquids (NAPLs) in the subsurface. Competition of these two forces can be observed on inclined interfaces of homogeneous sand formations. We have developed a multiphase flow code that has been applied to the study of NAPL behavior at the inclined interfaces. This model provides two methods for numerical treatment of sharp interfaces between the sands with different capillarity properties. Numerical results are presented indicating domains of applicability of these methods and their ability to describe discontinuous saturation profiles across the interface. The model is applied for computation of two-phase flow in a layered medium containing an inclined interface between two homogeneous layers with different capillary pressure parameters. As another application of the model, we present results of simulation of NAPL flow in a random medium consisting of small inclined homogeneous blocks of sands. Numerical results are compared to the results of laboratory experiments.