Sussex were 33 for no loss in their second innings on day three at Taunton before the visitors endured a nightmare three overs that saw them lose five wickets in 10 balls without adding a single run.
Thomas opened the floodgates by bowling James Anyon for 18 and then proceeded to dismiss both Rory Hamilton-Brown and Sussex danger-man Ed Joyce for ducks to complete a stunning hat-trick.
The change of over brought Peter Trego to the attack and within four balls he had sent Chris Nash (12) back to the pavilion, after the opener was caught by James Hildreth.
On the first ball of the next over, Thomas then made it four in four as he clean bowled Matt Machan for a duck to leave Sussex's hopes of victory in tatters.
Somerset led their opponents by 75 runs after the first innings.
It is the first time a Somerset player has taken four wickets in four balls in first-class cricket.
Surrey's Gary Butcher was the last man to achieve the remarkable feat against Derbyshire at The Oval in 2000.
- Sports & Recreation