There are a lot of ways.

1. Easiest is the dotted line. Take a round tip and in the Brush Editor set the spacing to 200% (or more).
2. Take something like the hard square 10 pixel tip and put it in the Pencil tool. In the Brush Editor, increase the spacing to 200% and set the roundness to 30% (this makes it a 3 by 10 rectangle now), also set the angle jitter to direction.
3. For something fancy, like what you often see in atlases such as dotted and dashed lines, you will have to use paths and the eraser tool. Using the Pen tool make your path, using the other pen options edit and tweak your path, then stroke the path with whatever tip you want. Eraser tips work just like brush tips so set up your tip and then stroke the path. Use this to erase something like large chunks then go back and stroke the path again with dots (dots that are smaller than the line is thick). When done delete the path.
4. You can make your own custom brushes but when you do so remember that PS will "read" this brush tip from left to right as if you were making an arm gesture from left to right. So if you make something tall and thin it will create a line that is fat. If you make something wide and thin it make a line properly.