Pfizer Inc. raised the list price of Viagra by 13% in June. Less than a week later, Eli Lilly & Co. pushed up the price of its competing pill Cialis by the same percentage.

The two companies, though rivals, followed a common industry practice: raising prices almost in lockstep. For years, Pfizer and Lilly have taken increases on their erectile-dysfunction drugs within weeks of each other—sometimes even on the same day—keeping the list price of each pill within a few dollars.

The...