You feel a headache coming on, so you ask a friend for a painkiller.

They offer you Advil, Tylenol, Bayer, or Aleve. What do you take?

While these drugs treat similar issues, they’re extremely different from a pharmacological standpoint. Before taking them, you should know how they work—and whether they’re a safe choice for treating your pain.

Note that every person is different, and you might find that you’re especially susceptible to certain side effects from the medications listed below. As such, you should always consult with your doctor before taking painkillers for a diagnosed condition.

This is especially important if you intend to take a painkiller regularly. Some painkillers aren’t intended for this usage and can put your health at risk. With that said, let’s dive in and take a closer look at a few of the most popular options.

Tylenol is the most popular brand name for paracetamol.

Paracetamol has a low incidence of side effects compared with some other painkillers, but it does have very serious side effects when taken too frequently. It’s typically fine for headaches and other short-term aches and pains provided that you take a proper dosage.

Because paracetamol is processed through the liver, you shouldn’t take it after consuming adult beverages. It can cause liver failure when taken in large amounts or for an extended period of time.

Aspirin is the most common type of non-steroidal anti-inflammatory drug (NSAID).

As the name implies, these are drugs that limit inflammation. Bayer is one of the most common brand names for aspirin.

Aspirin does this by slightly thinning the blood, and when taken in low dosages on a regular basis, it can actually fight heart disease. There’s even some evidence (albeit limited at this time) that aspirin can help to prevent certain cancers from forming.

Of course, there are no free rides when it comes to painkillers, and aspirin’s no exception. Large amounts of aspirin can create stomach ulcers. Some people also find other NSAIDs to be more effective for arthritis and other chronic disorders.

Ibuprofen is another NSAID.

The most popular brands of ibuprofen include Advil and Motrin. Note that these brands may offer products that contain additional substances other than ibuprofen; be sure to read the labels carefully.

Side effects associated with ibuprofen include stomach ulcers, skin sensitivity, and hypertension. The painkiller is often used to relieve pain from musculoskeletal disorders, although physicians take a number of factors into consideration when recommending ibuprofen for this purpose—for instance, the cardiovascular health of the patient.

Aleve is the most popular brand of naproxen.

Naproxen and naproxen sodium are, you guessed it, NSAIDs, similar in many ways to ibuprofen.

However, there’s a higher risk of stomach ulcers with naproxen (although this risk is still low compared to some other NSAIDs that you might receive from your doctor). To reduce this risk, never take naproxen on an empty stomach.

Naproxen should never be taken with blood thinners, diuretics, antidepressants, lithium, or many other medicines, so if you take any medication regularly, check with your doctor before using this product. In fact, that’s a good rule of thumb for any painkiller.