This paper presents an investigation into the static response of an infinite beam supported on a unilateral (tensionless) elastic foundation and subjected to arbitrary complex loading, including self-weight. A new numerical method is developed to determine the initially unknown lengths that remain in contact. Based on the continuity conditions at the junctions of contact and non-contact segments, the response of the whole beam may be expressed through the displacement constants of the initial segment, reducing the contact problem to two nonlinear algebraic equations with two unknowns. The technique has been named the transfer displacement function method (TDFM). Comparison with the exact results of a particular limiting case shows the expected complete agreement. Finally, an example of a beam with several contact segments is presented and verified by the application of equilibrium conditions.