As I already wrote a lengthy piece about stretching I won't repeat myself too much, but stretching is actually 'meant' to be painful. Your muscle has several proprioceptors (muscle spindles and Golgi tendon organs) that protect the muscle against possible injury. Basically, its supposed to hurt!
While this pain gets less due to habituation of the CNS to the signals of your muscle's nerves, this is more a 'stretch tolerance' than an actual physiological change required to get 'longer' muscles. This only happens when you stretch frequently, which might cause stretch-induced-hyperthrophy. Sadly, this effect is easily lost again if you stop stretching, because your body constantly adapts itself to its loads.
So what can you do?
Exercise with a larger range of motion. Since your body adapts itself to the loads you apply to it, either you should use your body in more stretched positions (with an increased range of motion) or you should forget about stretching altogether, because you won't sustain it anyway.1
An exception to this would be if you have a lack of flexibility due to a wrong posture (Hello programmers!), injury (broken limbs) or some other cause (stroke). In these cases it may be advisable to stretch to retain a more natural posture or range of motion.
1: There may be situations where it is beneficial, however I remain skeptical that these athletes should look at how they exercise before thinking that stretching will solve their problems.
The explanations above are very summarized and somewhat incomplete, for a more complete overview I suggest you read several of the literature reviews about stretching