We show that optimal debt contracts in the presence of product market competition are typically different from standard debt contracts. We consider a market with two incumbents, one levered (target) and one with deep pockets (competitor). Renewal of target's debt depends on its profits, which are determined by the competitor's pricing strategy. When the competitor benefits from non-renewal of target's debt, it has incentive to price more aggressively. To counter this, bondholders make renewal less profit sensitive, and the optimal debt contract is smooth (nonkinked) and concave, and lies below the standard debt contract. Bondholders leave the limited liability constraint slack in a region of profits, and therefore appear to leave money on the table by failing to collect all profits when they fall short of the debt's face value. But this flattening of the contract results in higher profits for the levered firm for each state of demand, and a higher expected payout for bondholders. The larger the competitor's benefit from non-renewal, the flatter the contract. On the other hand, when the competitor benefits from renewal of the target's debt (say non-renewal results in target's replacement by a more efficient entrant), then the optimal debt contract is nonsmooth (sometimes taking the form of a binary option), and much more profit sensitive for some profit levels than the standard contract. This increased sensitivity amplifies the competitor's incentive to price less aggressively, resulting in higher profits for the levered firm and higher payout to bondholders. In either case, our results demonstrate the optimal contract must be designed accounting for the impact of the contract itself on the profit function of the levered firm. Furthermore, bondholders prefer lending to weaker firms (firms whose competitors benefit from renewal) because the competitor's pricing incentive, amplified by the more profit sensitive contract, results in higher expected payouts.