In passing maneuvers on two-lane highways, assessing the needed distance and the potential power reserve to ensure the required speed mode of the passing vehicle is a critical task of speed planning. This task must meet several mutually exclusive conditions that lead to successful maneuver. The paper addresses three main aspects. First, the issues of rational distribution of the speed of the passing vehicle for overtaking a long commercial vehicle on two-lane highways are discussed. The factors that affect maneuver effectiveness are analyzed, considering safety and cost. Second, a heuristic algorithm is then proposed based on the rationale for choosing the necessary space and time for overtaking. The initial prediction's sensitivity to fluctuations of current measurements of the position and speed of the overtaking participants is examined. Third, an optimization technique for passing vehicle speed distribution over the overtaking time using the finite element method is presented. The adaptive model predictive control is applied for tracking the references being generated. The presented model is illustrated using simulation.