The cost for 22 drugs shot up more than 500 percent per dose from 2013 through 2017, according to a Bloomberg Government analysis of Medicare Part D data released by the Centers for Medicare & Medicaid Services.

The median increase among drugs offered through Medicare’s primary prescription plan was 28 percent from 2013 to 2017, but some medications went up in price more than others. The median is the midpoint of the spending-change distribution, meaning that the same number of drugs changed in price more and less than 28 percent.

“Those very high prices on individual drugs can be barriers...