How steep is the area they're fighting in?
This is the crux of the question. When they get attacked, are they walking up an inclined part, or are they actually using climbing gear?
Walking up a hill/mountain
In this case, you can use the terrain rules, as follows:
Gradual Slope
This incline isn’t steep enough to affect movement, but characters
gain a +1 bonus on melee attacks against foes downhill from them.
Steep Slope
Characters moving uphill (to an adjacent square of higher elevation)
must spend 2 squares of movement to enter each square of steep slope.
Characters running or charging downhill (moving to an adjacent square
of lower elevation) must succeed on a DC 10 Balance check upon
entering the first steep slope square. Mounted characters make a DC 10
Ride check instead. Characters who fail this check stumble and must
end their movement 1d2×5 feet later. Characters who fail by 5 or more
fall prone in the square where they end their movement. A steep slope
increases the DC of Tumble checks by 2.
This isn't that bad. They may be moving more slowly and have some attack penalties, but for the most part they can operate normally without a lot of extra risk.
Climbing up a Cliff/Steep Incline
If they're using climbing gear and Climb checks (such as if they're going up a cliff), then things get problematic. Here's the relevant Climb rules:
You need both hands free to climb, but you may cling to a wall with
one hand while you cast a spell or take some other action that
requires only one hand. While climbing, you can’t move to avoid a
blow, so you lose your Dexterity bonus to AC (if any). You also can’t
use a shield while climbing.
Any time you take damage while climbing, make a Climb check against
the DC of the slope or wall. Failure means you fall from your current
height and sustain the appropriate falling damage.
For the players, this is bad. They have to use one hand to hold on, or they fall. They lose their Dexterity to AC, and they can't use a shield. They can only use one hand to attack. If they want to try to get away, Climb only lets them move at 1/4 their normal speed. The climb rules in full have some extra things in them that would be worth reading.
Fighting in these conditions is very difficult at low level, as you don't have tools like Spider Climb or Flight spells to help you.
Your Spider has a Climb speed, and thus gets different rules:
A creature with a climb speed has a +8 racial bonus on all Climb
checks. The creature must make a Climb check to climb any wall or
slope with a DC higher than 0, but it always can choose to take 10,
even if rushed or threatened while climbing. If a creature with a
climb speed chooses an accelerated climb (see above), it moves at
double its climb speed (or at its land speed, whichever is slower) and
makes a single Climb check at a -5 penalty. Such a creature retains
its Dexterity bonus to Armor Class (if any) while climbing, and
opponents get no special bonus to their attacks against it. It cannot,
however, use the run action while climbing.
So for the Spider, this isn't a big deal. It can take 10 on any climb check (instead of rolling, the result of the roll is a 10). It's got a very large bonus, so it's not going to fall. It doesn't get penalties to its AC due to climbing.
The Spider here is at a considerable tactical advantage as it can move around far more easily, isn't limited in its abilities, and is extremely unlikely to fall if it does get hit.
Falling
If they fall and don't catch themselves, they'll take falling damage based on how far they fall. Here's the damage rules for falling. If they're just sliding down a hill they could catch themselves using the Climb rules, so it may not be this bad (falling off a cliff is really bad!).
The basic rule is simple: 1d6 points of damage per 10 feet fallen, to
a maximum of 20d6.
If a character deliberately jumps instead of merely slipping or
falling, the damage is the same but the first 1d6 is nonlethal damage.
A DC 15 Jump check or DC 15 Tumble check allows the character to avoid
any damage from the first 10 feet fallen and converts any damage from
the second 10 feet to nonlethal damage. Thus, a character who slips
from a ledge 30 feet up takes 3d6 damage. If the same character
deliberately jumped, he takes 1d6 points of nonlethal damage and 2d6
points of lethal damage. And if the character leaps down with a
successful Jump or Tumble check, he takes only 1d6 points of nonlethal
damage and 1d6 points of lethal damage from the plunge.
Falls onto yielding surfaces (soft ground, mud) also convert the first
1d6 of damage to nonlethal damage. This reduction is cumulative with
reduced damage due to deliberate jumps and the Jump skill. Falling
into Water
Falls into water are handled somewhat differently. If the water is at
least 10 feet deep, the first 20 feet of falling do no damage. The
next 20 feet do nonlethal damage (1d3 per 10-foot increment). Beyond
that, falling damage is lethal damage (1d6 per additional 10-foot
increment).
Characters who deliberately dive into water take no damage on a
successful DC 15 Swim check or DC 15 Tumble check, so long as the
water is at least 10 feet deep for every 30 feet fallen. However, the
DC of the check increases by 5 for every 50 feet of the dive.
So, how to run this combat?
If you're a newbie DM, I would suggest that you be careful about having one of your early combat situations be while climbing. Given the tactical situation of the party, if the Spider gets the upper hand it could start knocking party members off the mountain and killing people with falling damage.
One idea would be to have the party find a ledge or other flat/gentle slope area the mountain where they can rest and break. When they leave that and start climbing again, have the Spider attack them 30 or 40 feet up. That way if they fall, they'll have a spot to fall to that isn't likely to be instant death. It may knock them below 0 HP, but healing can stabalize them quickly so they don't die.
The Spider at that point can want to hold it's territory farther up, and if the party fails to kill it the first time they'll have a spot to regroup from and try again. It also means they can retreat if things go wrong, and early on in your DM career having a safety net can be handy. :)
You'll probably want to have a copy of the Climb rules open at the table during this, as you'll need to consult them for things like someone falling and trying to catch themselves. Don't try to rush, if you need to take a moment after an action to figure out what happens, go ahead and do it. When you're new, sometimes these things take time.
Remember that putting some fear into them is good, but your goal isn't to kill them all with every combat encounter. The Spider can catch and trap them with its far superior climbing speed, but be careful about that. If they get into trouble and try to retreat, let them. A Spider guarding it's territory doesn't have to follow them down the mountain, and a fearful escape will both be fun and give them a chance to regroup and try to figure out how to win next time (which is really fun).