The west Wales outfit appeared set to be left empty handed after Andrew Trimble pounced for an interception try and Paddy Jackson added 14 points.
But Thomas, who had an inconsistent night with the boot, slotted a penalty with the last kick to salvage something from a
disappointing performance.
The defeat sees Simon Easterby’s men slip nine points behind Ulster in the PRO12 table and they now turn to Heineken Cup action with a tie with Exeter Chiefs on Saturday.
Thomas and Paddy Jackson were both off target in the opening exchanges at Parc y Scarlets but the Ulster fly-half fired the visitors into the lead on nine minutes.
Ulster attempted to utilise a chip and chase in the slippery conditions but Dan Newton was more than up to the task. He beat both Darren Cave and Luke Marshall with some neat footwork and superbly cleared his lines.
The Irish province were then penalised at the ensuing lineout and Thomas expertly curled the ball between the sticks.
But Ulster surged into the lead as Trimble intercepted Gareth Owen’s pass to race clear.
Jackson added the extras and quickly fired over a penalty to establish a 10-point advantage.
The Ireland international quickly got the scoreboard ticking once again following the break to stretch the visitor’s lead.
Thomas should have hit-back but fired wide for a second occasion but he made amends with a quick-fire double to reduce the deficit to 16-9.
That prompted Mark Anscombe to introduce Irish front-row duo Rory Best and Tom Court. And they instantly proved their worth with a scrum penalty, which Jackson slotted.
The Scarlets began to threaten in attack and in form wing Andy Fenby was a constant menace but Ulster weathered the storm.
Ulster were dealt a blow when Dan Tuohy was sent to the sin bin for killing the ball as the Scarlets surged forward.
Thomas failed to take advantage as he fired wide for a third time but he dissected the posts with the final kick of the game to grab a losing bonus-point.