The program ArtRage does this very well, I think by looking at that you can get a good idea of how to do this.
Each pixel on the canvas needs to store several attributes related to paint; you can imagine that each pixel will store the amount and color of the paint at that point at the minimum. Painting would be a matter of starting with a set amount of paint on the brush, then as the mouse traces a path to paint, remove some from the brush and add some to the affected pixels.
This is just an overview of the most simple way to do this, there are many more details that will make this look much better (such as shading with a light source to get the 'bump' appearance).