If you upgrade, I think it messes up, but the method to get them is exactly the same as Snow Leopard. Open the terminal and enter the following commands.
For left side (Application side):
Code:
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
For right side (Folder/Trash side):
Code:
defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'
Every time you enter it a new spacer is added. They won't show up until you reset the dock. Once you've done the command as many times as you want, type:
and the dock will reset. If you need to add more then just do the commands again. To take them out, drag them out like applications.