You're quite right, it isn't that easy!!
I'm not accurate here with all the technical details but in essence, if you're short of the stock you will have to pay the rough equivalent of the dividend in the same way that if you were long, you would get the divi but expect the stock to drop by around the same percentage.
You should also have a look at the chart patterns just before they go ex-div, you will often see shares with a higher % div rising just before the ex-div date and money can be made in that period as late buyers look to get in for the divi. but it's not that consistent or easy so beware!
I have also noticed that shares that have been trading strongly will fall by the divi amount on the first morning after going ex-div but will recover quickly and are often a goof intra-day trade if you are clever with your timing.