I have never tried to grow cucumbers, but I have heard irregular watering (letting them dry out) can cause these problems.
It may also be the type you planted. A study by Washington State University, for example, found that "Burpee Pickler" grown in a test plot had 90 percent bitter fruit. "Improved Long Green," on the other hand, had only 6 percent. You'll find additional tips for preventing bitterness here:
in Italy we cut the end off one side and rub it in circles on the cut part of the cucumber. It will make a white foam, that will draw out some of the bitterness of the cucumber out.