Scores a hit
An attack roll represents your attempt to strike your opponent on your
turn in a round. When you make an attack roll, you roll a d20 and add
your attack bonus. (Other modifiers may also apply to this roll.) If
your result equals or beats the target's Armor Class, you hit and deal
It doesn't matter if your damage surpass DR or THP. Hit from your weapon take place if your attack roll greater or equal than target's AC.
Temporary Hit Points
Temporary Hit Points
Certain effects give a character temporary hit points. These hit points are in addition to the character's current hit point total and
any damage taken by the character is subtracted from these hit points
first. Any damage in excess of a character's temporary hit points is
applied to his current hit points as normal. If the effect that grants
the temporary hit points ends or is dispelled, any remaining temporary
hit points go away. The damage they sustained is not transferred to
the character's current hit points.
When temporary hit points are lost, they cannot be restored as real
hit points can be, even by magic.
Even if you didn't surpass THP amount it's still counts as a solid hit. Supernatural ability or magic, that grants character/monster THP, just pull all damage from regular HP to THP. Any poison effects take place as intended, since there was damage to target. Because of THP target became tougher, not immune to certain amount of damage.
EDIT: Clarifying about THP and immunity
Q: But they are in fact immune to a certain amount of damage. If I gain 10 THP then take 5 damage, then have THP expire, I'm still at full health. Did I suddenly go from "injured" to "healed" by virtue of losing HP? Does the PC go from looking "beat up" to looking 100%?
A: @Gates VP - to clarify I need to quote this thing:
Hit points mean two things in the game world: the ability to take
physical punishment and keep going, and the ability to turn a serious
blow into a less serious one.
Immunity means there was no damage at all. In case of DR, if damage is too small to surpass certain amount - it's ignored. De-facto there was no damage at all. In case of THP you've recieved this damage. It was not ignored, it damaged you a little. But because of magic, or abilities it was not enough to hurt you seriously. To make an example:
You harness the power of unlife to grant yourself a limited
ability to avoid death
You recieve damage, but because of magic you can live a bit longer, survive a bit longer.
In case of feats
Drunken Brawler (Combat)
When you drink a tankard of ale or strong alcohol, you take a –2
penalty on Reflex saving throws, but gain a number of temporary hit
points equal to your level...
Have you ever heard expression that drunken people are tougher(not talking about stronger - it's a nonsense)? But in case of toughness they feel pain a bit less than sober. That helps them to endure some blows better.
Whenever damage reduction completely negates the damage from an
attack, it also negates most special effects that accompany the
attack, such as injury poison, a monk's stunning, and injury-based
disease. Damage Reduction does not negate touch attacks, energy damage
dealt along with an attack, or energy drains. Nor does it affect
poisons or diseases delivered by inhalation, ingestion, or contact.
Attacks that deal no damage because of the target's damage reduction
do not disrupt spells.
In that case you still score a hit, but because of some supernatural ability(or magic) your hit didn't do any damage to target. At all. Since there was no damage - there can't be any poison effects.
Why did I mention 'scores a hit' rules at the beginning
In both cases you should remember that poison works on 1 hit only. Even if you didn't surpass target DR or THP it doesn't really matter.
A poisoned weapon or object retains its poison until the weapon scores a hit or the object is touched (unless the poison is wiped off before a target comes in contact with it).