The attack gets the +2 to-hit modifier if the woods are intervening (between the two units) or if the target is in the woods.
If the attacker is in the woods, but there are no woods between the attacker and target, then the woods the attacker is in doesn't provide any Woods modifier to the attacker's to-hit roll.
Unit A is in Woods. Unit B is not, and there are no intervening woods between them.
Unit A attacking Unit B does not get a Woods to-hit modifier, there is no intervening Woods and target is not in Woods.
Unit B attacking Unit A does get a Woods to-hit modifier, for the target being in Woods.
If there are intervening Woods, then both Units get a single +2 Woods to-hit modifier on their attacks on each other.
(Note that in Advanced Rules, using Advanced Terrain, the various Woods/Jungle modifiers are "per X" and do stack.)
NOTE: This ruling has been changed by later errata.
http://bg.battletech.com/forums/index.php/topic,40226.msg928630.html#msg928630