Mattress rivals Tempur-Pedic and Sealy are becoming bedfellows. Tempur-Pedic, the 20-year-old leader in foam mattresses, is buying more-than-a century-old rival Sealy for about $228.6 million in cash. The acquisition comes as competition has increased in the mattress industry, with makers stepping up their marketing and promotions to help lure cost-conscious consumers into making big purchases. Tempur-Pedic International Inc. said it will pay $2.20 per Sealy share, which is a 3 percent premium to the company’s Wednesday closing price of $2.14. Tempur-Pedic says it will also assume or pay back all of Sealy Corp.’s outstanding debt. The companies put the total value of the deal at $1.3 billion. Tempur-Pedic and Sealy will run independently of each other.