A couple of things can cause what you describe. Misshapen cucumbers often are caused by hot, dry conditions during fruit set, soil that's not fertile enough to support the plants, or poor pollination. The problem happens more frequently in late summer because of high temperatures. The best prevention is to keep your plants mulched to maintain more uniform soil moisture, and improve your soil with lots of organic matter to aid water-holding capacity.
If you have good soil, poor pollination is a likely culprit. Improve the chances for good pollination by planting borage (a common herb) or other flowering plants near your cucumbers. The blue borage blooms attract bees, which will also pollinate your cucumbers more thoroughly. Avoid using insecticides in your garden; these products kill bees as well as harmful insect pests.