When Tampa Bay Ray's relief pitcher Joel Peralta was ejected from a game last week because there was pine tar on his mitt, he joined a century-long list of Major League baseball pitchers who have done whatever they needed to do to get the upper hand.

From spitballs to scuffed balls, pitchers have been cheating as long as there have been rules.

Whether Peralta's technique actually gave him any edge, though, is up for debate. No one has ever studied the effects of pine tar on the flight of a baseball. And so far, nothing egregious has shown up in Peralta's pitching stats to suggest that his cheating techniques have given him a leg up.

Still, rules are rules, and they exist for a reason. Theoretically, putting any kind of foreign substance on a ball could make it move erratically, confusing and possibly even endangering batters.

BLOG: Physics Debunks Baseball Myths

"Not being allowed to doctor the ball seems like a sensible rule to me," said Alan Nathan, a physicist at the University of Illinois at Urbana-Champagne, and an expert on the physics of baseball. "You can affect the trajectory of the baseball by doctoring it."

There are two main ways to fiddle with a ball, Nathan said. The first is to add lubrication to reduce friction between the ball and the pitcher's fingers. That, in turn, diminishes the throw's natural backspin, making the ball drop more quickly than a normal fastball would. This is what makes the spitball so infamous.

The second category of messing with a baseball is to roughen up its smooth surfaces. Whether scuffed with an emery board or gouged with a fingernail, compromised balls tend to break in the direction of the scratched side.

In the early days of baseball, pitchers were free to do whatever they wanted -- and they did, said Dave Baldwin, a retired Major League baseball pitcher and author of the baseball memoir "Snake Jazz." Tricks included putting licorice on the ball to make it darker and harder for batters to see, sticking pins in the ball, or smudging substances on one side to make the wobble or move strangely.

NEWS: Penalty Kick Psych-Outs: How They Work

Then, in 1920, Yankees pitcher Carl Mays threw an extraordinarily hard submarine pitch, which rose from ground level, struck Cleveland Indians batter Ray Chapman in the head, and killed him. Chapman didn't react to the pitch at all. It appeared that he didn't even see it coming.

Chapman's death led to a swift and dramatic shift in the rules of baseball. Pitchers could no longer put foreign substances on the ball or their hands other than rosin, which is an approved powder that helps make sweaty hands less slippery. And when balls got dirty during play, umpires replaced them.

Instead of putting a halt to the cheating, though, the new rules only drove pitchers to get sneakier about their tricks. In the 1960s and 70s, when Baldwin was playing, pitchers used Vaseline to lubricate balls until K-Y Jelly came on the market and became the baseball-moistener of choice. The water-based lubricant evaporated during flight, making it almost impossible for umps to detect.

HOWSTUFFWORKS VIDEO: The Physics of Pitching

Other times, pitchers coated the ball with talcum powder, which was white and -- unlike baby powder -- odorless. The powder would fly off in flight, and it could make balls sink more quickly than expected. Pitchers might hide small bits of emery board on their belts or under their caps to sneak on a scuff mark or two. Even today, catchers may intentionally throw a ball that bounces right before a game begins, hoping the umpires won't notice.

Pitchers aren't the only ones who try to cheat, Baldwin added. Batters are notorious for putting cork or metal rods in their bats to change their weight or flexibility. And, because doctored bats are harder to detect than doctored balls, he suspects that batters cheat more often than pitchers do.

To work around the ever-watchful eyes of umpires and TV cameras, modern-day pitchers have turned instead to more innovative forms of pitching. Throws like the split-finger fastball -- which suddenly drops when it reaches the batter -- or the knuckleball, which spins less than a typical ball, are perfectly legal, but they can keep a batter guessing.

As for Peralta's pine-tar trick, the pitcher's motivation remains a mystery.

"Pine tar is very easy to detect," Baldwin said. "It just doesn't make any sense why any pitcher would try to use that."