What's a code share then? Put in simple terms, it's when one airline buys a bunch of seats on another airline at a contract price, and then sells them for whatever they can get. For example, Delta flies nonstop from New York JFK to Pisa, Italy, and Alitalia, which doesn't fly that route nonstop, wants to list that flight in its schedule. This makes Alitalia look like a bigger, more comprehensive airline, which supposedly is good for business. Delta and Alitalia are then said to be in a code share agreement on that route.
Here's how you can save money: when looking for fares, check to see if there's a code share flight on another airline. You can get this information from the airline or a travel agent usually, or you can often figure it out by looking at fare results on a site like Kayak.com. In the case of New York to Pisa, as the screen grab from Kayak shows below, you can save over $200 by buying the exact same nonstop Delta flight via Alitalia rather than on Delta itself. In fact, you could spend up to $968 RT on various travel days for this route, vs. a possible low of $645. Nuts, no?