A simple way to create a straight edge is to stretch a string line between two stakes or sticks of bamboo. Make sure the string is pulled taut so that it stays in place while you're working. Then cut down into the soil using an edging spade or a half-moon edger. You only need to cut two to three inches down into the soil.
After you've finished cutting the line, go back and collect the pieces of sod. Knock the soil from the roots and scatter it into the garden; place the remaining grass in your compost heap.
If you'd like a more permanent raised edge, insert bricks, long, narrow slabs of bluestone, or terra-cotta roofing tiles several inches down into the soil. All of these weather beautifully and will last for years.