Though federal law strictly mandates that name brand and generic drugs must contain equal amounts of identical active ingredients, different generic drugs contain different inactive ingredients. The ingredients used to increase the size of pills to usable dimensions (you would barely be able to see a pill that actually weighed 25mg) vary from manufacturer to manufacturer.
Sometimes, patients may have an unexpected sensitivity to one of these "filler" ingredients, or to the agents used to color the pills.
Other times, certain physical properties of the pill might be different between the name brand and generic versions. For example, one might dissolve more quickly in the stomach. This is a little bit complicated, because the law says that the actual bioavailability of the generic must be the same as the name brand, but it is possible to make pills that dissolve more quickly in the stomach while the active ingredient is still absorbed from the stomach at the same rate. For some medications, even though the drug isn't leaving the stomach at a different rate, having a relatively high concentration of active ingredient "sitting" in the stomach can cause irritation that leads to upset stomach or nausea.
Very rarely, patents may actually be allergic to one or more of the inactive ingredients used in generic medicines.
If you are having side effects after being switched to a generic drug, the first thing to do is wait a while. You might just need a little time to adjust to the new formulation. This shouldn't take longer than a week or two, though, so if you're still having the side effects after waiting for that long, make an appointment to see your doctor. In some cases, there may be more than one generic formulation of the drug available, which means that you can try another generic and see if the side effects go away. If there are no other generics, it might be necessary to switch back to the name brand drug.