They both mean the same thing but the nuance is as follows:
〜さ (as in 悲しさ、楽しさ、痛さ) indicates a degree or an amount of 〜
〜み (as in 悲しみ、楽しみ、痛み)indicates a state of being
I find the following contrasting examples as definitive:
A:「痛さはどれくらいですか?」 = implies amount
B:「痛みの程はどれくらいですか?」 = we add 程{ほど} to indicate an amount
However, to make things easier (or harder) B is starting to imply "an amount" too (I'll see if I can find an example).
My supposition is that A was originally "the correct way", but so many people used the incorrect way that it is becoming correct; just like in English, meh!
On OKWave I found the following useful examples:
「痛み」: 痛むこと、痛んでいる状態にあること = Pain, in a state of pain
「痛さ」: どれだけ痛んでいるかの状態・程度 = A state indicating how much pain, an amount
○「私達の心の痛みがわかりますか」=「私達の心が痛んでいることがわかりますか」
=> Do you understand that our hearts are pained (by this)?
○「私達の心の痛さがわかりますか」=「私達の心がどれだけ痛んでいるかがわかりますか」
=> Do you understand exactly how much our hearts are pained (by this)?
△「かなりの痛みだ」(NG)
○「かなりの痛さだ」= very painful
○「かなりの痛みがある」= very painful
△「かなりの痛さがある」 (NG)
Note, preceding「がある」the most appropriate option is「痛み」.
○「軽い痛みがある」= a little painful
△「軽い痛さがある」 (NG)
(Source: http://okwave.jp/qa/q6754018.html)