The pair put on a fourth-wicket stand of 72 as the hosts closed day two on 304-9, a lead of 166.
Spinner Yasir Shah continued his good form as he picked up 5-95, becoming the fastest Pakistan bowler to reach 50 Test wickets, before rain forced an early finish to the day???s proceedings.
Sri Lanka began the day 70-1 with Silva and Kumar Sangakkara batting as they pushed hard to draw level in the series after bowling out the visitors for 138 on day one.
Sangakkara chipped in with 34, but it was not until Mathews joined Silva at the crease that the hosts took the initiative with the pair scoring 77 and 80 respectively.
Silva hit 10 fours in a 218-ball innings before being run out while Mathews was trapped lbw to become Shah???s fourth victim of the day.
Shah also claimed the wickets of Dinesh Chandimal and Kithuruwan Vithanage in quick succession as well as those of Lahiru Thirimanne and Tharindu Kaushal before the weather forced an end to the day???s cricket.
That meant it was back-to-back five-wicket hauls for the 29-year-old taking him past a half-century of victims in only his ninth Test.
Day three will resume with only Rangana Herath (10) and Dushmantha Chameera (0) at the crease.