There are many factors at work in addition to your rating, your opponents rating, and the result.
There is also something called the RD (Ratings Deviation). In a way, it is a measure of the accuracy of the rating, and each of you have one. The RD is adjusted up or down with every game, but it also slowly climbs up in between games (older ratings are considered less accurate).
So your rating changes based also on your RD and your opponent's RD. If your RD is high (inaccurate), then your rating will swing a little more wildly until the RD goes down. If your opponent's RD is high, then your rating will change less so that you do not get unduly rewarded or punished for playing someone with an inaccurate rating.
, but I'll admit I know a bit more now than I did before. There's certainly a lot more to ratings than I thought there was!
I just finished a game of online chess. Before I resigned, my rating was 1280 and my opponent's was 1300. After I resigned, my rating was 1273 (as I would expect) but his was 1315, an increase of 15 points for beating an opponent with a lower rating. Does this make any sense at all?