If the cost of your prescription medicine is giving you a headache, you’re not alone.

Last year Americans filled a record 4.3 billion prescriptions at a cost of $374 billion, which was 13 percent more than the amount they had paid the previous year, according to the IMS Institute for Healthcare Informatics.

“People don’t tend to clip coupons at the pharmacy because their medicine is a health-care product, it’s not a commodity,” said Janet Engle, past president of the American Pharmacists Association and executive associate dean of the University of Illinois at Chicago College of Pharmacy. “But it’s a good idea to ask questions and try to save money with your medication, as long as you do it smartly.”

Pharmaceutical experts clued us in on how to get the biggest discounts at the pharmacy counter.

Shop around: A 2013 study by Consumer Reports found that doing a little comparison shopping can have a big payoff, especially if you’re paying out of pocket for your medications. The study found a $749 difference between the highest- and lowest-priced stores when shopping for a month’s supply of five drugs. Costco was the least expensive (and you don’t have to be a member to use its pharmacy), while CVS, Target and Rite Aid were the most expensive.

Be proactive about getting the generic version: Ask if there are generic or less-expensive brand-name drugs that would work just as well as the prescription and over-the-counter medications you’re taking now,” Engle said. “If a generic is not available, check to see if you can use a therapeutic alternative, which is a similar drug that gives the same result that is available as a generic.”

Split pills: Check with your pharmacist to see if your medication is safe to split and if it is available in a variety of strengths that cost about the same amount. If this is the case, ask your doctor to write a prescription for double the strength, and you can split the pills in half by using a pill splitter, Engle said. It is best to split one pill at a time rather than splitting the whole bottle at once. That way, if there are more milligrams in one half than the other, you will take the correct dosage over two days instead of stretching mismatched dosages out over a month. But capsules, gel caps and certain timed-release pills should never be split.

Buy in bulk: Instead of buying a two-week or monthly supply, get permission from your insurance company to place your order in a larger volume to get a bulk discount, said Derek Fitteron, founder and CEO of Medical Cost Advocate, an organization that helps individuals and companies negotiate medical billing in New Jersey.

Ask about a patient assistance program: Run by pharmaceutical companies, these provide free medication to those who can’t afford their medicine, said Goldina Erowele, clinical pharmacy educator with CareNovate Magazine, which provides resources about social health. You can ask your pharmacist about it or find more information online at http://www.rxassist.org.

Buy medication online - with caution: While it may seem tempting to buy medication overseas if the prices seem better, drug-regulatory systems in other countries may be weak or nonexistent, and there is a problem with counterfeit and substandard medicine there, said Michael Carome, director of the Washington-based Public Citizens Research Group. Many raw materials, active pharmaceutical ingredients and even some finished products for American drugs sometimes do come from overseas, but that’s still different from buying the product online from an overseas pharmacy. “Every step of the way is inspected by the FDA when it comes to an American pharmacy,” Carome said.

Still, websites such as LegitScript have vetted online pharmacies - most of which are American - and it’s possible to save 5 to 15 percent on medication using one of its 200-plus pharmacies. “We classify them by their legitimacy and call out those that are not,” said John Horton, president of the Portland-based LegitScript.

To check an online pharmacy’s legitimacy, you also can visit www.nabp.net for a list of those vetted by the National Association of Boards of Pharmacy, said Carmen Catizone, executive director of the organization. The pharmaceutical website you select should have the NABP seal at the bottom of the site. “A lot of people go online because they hear that it’s cheaper,” Erowele said, “so there are regulations in place.”

Get samples: Physicians often have samples of the prescriptions they write, so ask your doctor for a sample when you get a new prescription, Catizone said. While it won’t reduce the cost of your prescription, it’ll get you a few weeks or even a few months for free, and it will give you the chance to make sure the medication works before you invest.

Don’t use insurance: There are a number of companies that offer prescription cards, and using these cards can be a less expensive option than paying for medication via your insurance company. The prescription cards typically will be free, Fitteron said. “It might be better than what you’d be getting from your prescription plan, depending on what your deductible would be,” he said. Fitteron suggested speaking with the pharmacist about the prescription cards and presenting them at the pharmacy before doing a cost comparison to see which would be the least expensive option. These are offered as membership benefits via AAA or AARP, but they also are available for free at some websites such as www.drugs.com and www.simplerx.com. (Each card has different prescription prices, and they’re for prescriptions not covered by insurance). The sponsoring organization typically receives a fee from the 50,000 national drugstores accepting the cards for each prescription filled.

Ask about price matching: It’s best to get all your prescriptions in one pharmacy so the pharmacist is aware of which medications you’re taking. But if some of the medications are higher at one pharmacy, you can ask if it will price-match, Engle said. “Some will try to match prices to keep the business,” she said. “Sometimes the pharmacist is the only safeguard against drug interactions, but if you shop from pharmacy to pharmacy, you are losing that safety measure and to save a dollar or two, it is not worth the risk.”

Take advantage of Medicare and the Affordable Care Act: Some Medicare drug plans have a coverage gap, which is the amount of money that you end up spending after Medicare has kicked in. But if you’re enrolled in the Medicare Prescription Drug Plan (including your employer group health and waiver plans) or an HMO or PPO and you don’t get extra help for limited income, you can qualify for the drug plan’s assistance once you’ve reached the coverage gap. For more information, call 800-633-4227.