My cat has had this 3 times in the past 6 months--The vet told me it is from either severe diarrhea or constipation---where he is straining and he hurts his intestines--This also happened to my girlfriend's dog--
If it is diarrhea make him something with rice--either ground meat cooked or chicken or tuna the rice will bind him--If it is constipation I am not sure--this just happened again to me today--taking back to vet tommorrow---I think there is a cat laxative if it is constipation vet can give Rita-