The Israeli military said it was responding to being fired upon, in what is the most serious test yet of this month’s US-brokered truce.