Best way I know to learn the racing rules is to get Dave Perry's book "Understanding the Racing Rules" for the current year, from USSA or on Amazon, etc. Perry doesn't just explain the rules, he diagrams them and explains the larger context. You can say "why should I pay for this when the rules are free" but believe me, the book is enlightening. Bill Gladstone's book is also invaluable.
From your description, I don't understand which tack you were on, or they were on. It sounds like you were going upwind and they were coming downwind but (and I could easily be wrong, I'm in cruising mode) it sounds like the only rule to apply is Rule 10 "On opposite tacks: ...a port tack boat shall keep clear of a starboard tack boat".
I don't see anything in a windward/leeward upwind/downwind reference in the current rules that would bear here, what am I missing?
What tack were you and they on?