There are three main types of stretching that the general layman will be familiar with. There are a couple of others, but they are extreme techniques, and generally not used by the everyday athlete.
- Ballistic - The "lean and bounce" method, where you repeatedly bob back and forth in the stretch
- Dynamic - Mimics the motion of the activity in increasing amplitude
- Static - Traditional "lean and hold" type of stretching.
Ballistic is old fashioned, and has been contraindicated for quite a while. One of the big risks is activating the stretch reflex in the tendon (This is what causes your knee to jerk when the doctor whacks you with the hammer), and this causes your muscle to try and tighten (shorten) at the same time you are actively lengthening it. This can produce tears, avulsions or tendon ruptures.
Dynamic is recommended before activity, especially if you are doing an activity that requires great extremes of motion (Such as martial arts or gymnastics). This is simply doing the motions of the sport starting with slow, short movements and gradually increasing the range and power. Skips into bounds before running is one example of this. As evidenced by this study, dynamic stretching before activity showed greater gains in jump power, where ballistic and static stretching did not show the same gains.
Static should be done after activity if it is done. Several studies have shown that static stretching before activity (especially in power based activities) actually decreases performance. The main purpose of static stretching is to increase range of motion (ROM) in the area being stretched. This study shows a decreased resistance to passive resistive torque (How far the joint can move before resistance begins), i.e. gains in flexibility with static where ballistic did not show the improvement. Ballistic did, however, reduce stiffness in the studied tendon (Achilles).
There is currently no evidence that stretching will alleviate muscle pain, and while it is popular to do, not much evidence that it helps alleviate cramps, either. Static stretching (contrary to popular belief) has also not been proven to reduce injury rates (As shown by this review article of the literature) or assist with such things as delayed onset muscle soreness (DOMS), "flush" lactate out of the muscles, or anything. If it helps relax you, or if you need extreme ranges of motion for a specific sport, it can help, but other than that, there isn't much evidence for it to support performance increases.
Also, since you mention that you play baseball, there is some evidence (Although I can't find the study at the moment) that preswing warmups should be done with a lightweight bat rather than a weighted bat, as it helps increase the following swing speeds.
Addition: While reading through references, I did find some notations that ballistic stretching post exercise could possibly produce greater gains in flexibility, at the cost of a higher injury risk.