Easy. Add the two numbers together, as positive numbers. Generate a random number in that range, and subtract your lowest number. As you have here..
501 + 50 = 551
random number from 0 to 551
subtract 501
So, if the random generated number is 551, subtract 501, you get 50. Your top number.
If the number is 0, you subtract 501, you get, of course, -501, your lowest number.